Page 1 of 1

Implementing RollingOnSurfaceConstraint() using OpenSim API

Posted: Wed Oct 19, 2022 7:27 am
by imihasan
Hi everyone,

I'm creating a simple model of a wheel rolling without slipping on an inclined plane. Initially, I was modeling the interaction between the wheel and the inclined plane as a contact problem. The wheel is modeled as a contact sphere, the platform as a half space and HuntCrossleyForce was used to model the contact forces. I was expecting that the wheel will slide without rolling when I set the coefficient of friction to zero. But actually whatever the value of the coefficient of friction, the wheel rolls in the same manner and it looks like friction doesn't affect the motion at all.

Then I changed the modelling strategy to impose a rolling on a surface constraint between the two bodies. I use MATLAB API. The thing is that I'm not able to define the constraint or declare it in my script. Whenever I define it, it give me error "Unrecognized function or variable 'RollingOnSurfaceConstraint'."

Is there any guide how to define this class? or any recommendations on modeling this problem?

Thanks in advance!

Re: Implementing RollingOnSurfaceConstraint() using OpenSim API

Posted: Wed Oct 19, 2022 9:03 am
by tkuchida
The RollingOnSurfaceConstraint is not wrapped to Matlab. I've reported this on GitHub (Issue #3302): https://github.com/opensim-org/opensim-core/issues/3302. The constraint exists in OpenSim so models that contain this constraint can be loaded in Matlab, but the constraint cannot be created in Matlab. As a workaround, you could add the constraint to the model another way (e.g., in C++ or by editing the .osim file in Notepad) and read in the model file in Matlab. The XML template for this component (the code that appears in the .osim file) can be found in the GUI under Help -> XML Browser -> RollingOnSurfaceConstraint.

Re: Implementing RollingOnSurfaceConstraint() using OpenSim API

Posted: Wed Oct 19, 2022 9:27 am
by imihasan
That actually helps. Thanks a lot professor Thomas!