Page 1 of 1

CustomJoint modelling using MATLAB

Posted: Wed Feb 19, 2020 8:26 am
by a.wolf
Hello everybody,

I am trying to model a CustomJoint using Matlab. Unfortunately I'm struggling very hard with it, so I'd like to ask if someone could provide a "Blueptrint" code for the CustomJoint definition. I have attached my code which I use to try to connect a body "cylinder" to the body hand via a joint with one translational and one rotational degree of freedom. Unfortunately this code creates a CustomJoint without sockets and empty coordinates.

Thanks a lot!
Alex

(Software used: OpenSim4.1; Matlab2019a; Windows 7 - 64bit)

Re: CustomJoint modelling using MATLAB

Posted: Mon Feb 24, 2020 12:13 am
by aymanh
Hi Alexander,

Please check the code (though in C++) at
https://github.com/opensim-org/opensim- ... Joints.cpp

In most cases, CustomJoint would be an overkill if you can use the less general but simpler to use other types of Joints (e.g. PinJoint, SliderJoint, BallJoint....) which gets you around dealing with the complicated SpatialTransform altogether. Example usage of these joints is shown in the same test case code above.

Hope this helps,
-Ayman