Translation after rotation of a body

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Laura Peeters
Posts: 11
Joined: Thu Nov 28, 2013 9:12 am

Translation after rotation of a body

Post by Laura Peeters » Thu May 22, 2014 8:34 am

Hi!

Let me first give a situation overview of my problem. I have a body (a tube) which needs to be able to rotate in 3 dimensions (x, y and z) and it needs to be able to translate along the z axis (this is the direction in line with the tube). But this translation should be around the current (after rotation) z axis of this body.

I'm using a free joint for this movement, but the translation of the body is always around the 'default' local axis of the body (see attachment for an illustration of the problem). I want this translation to be along the new z-axis after rotation of the body, so in line with the position of the tube. I've also tried to use a custom joint, but the problem is that I don't know the amount of translation that I need, so I can't define a function of the translation that comes with a certain rotation of the body.

Does anyone knows how I can solve this problem? Or how I have to define the joint?

Thanks in advance!

Regards Laura
Attachments
Translation_problem_OPENSIM.png

User avatar
Michael Sherman
Posts: 807
Joined: Fri Apr 01, 2005 6:05 pm

Re: Translation after rotation of a body

Post by Michael Sherman » Thu May 22, 2014 9:19 am

Hi, Laura. There are several different ways to do this. By far the simplest would be to introduce a massless intermediate body. You would attach the massless body to the parent by a Ball joint, providing three rotational degrees of freedom. Then attach the tube by a Slider joint along the massless body's Z axis.

One thing to clarify is exactly how many degrees of freedom you want for the tube. I'm guessing 4, but that requires that the tube has reasonable inertia about its long axis. If it is essentially inertialess in that direction, you could model it with just 3 dofs (a U-joint plus a Slider). It is also possible that you want to give the tube 6 dofs but using a more convenient coordinate system than is provided by a Free joint; that wasn't clear from your post. In any case an intermediate massless (and inertialess) body is a great trick since, stripped of mass, a body is just a coordinate frame.

Would this approach work for your application?

Regards,
Sherm

User avatar
Laura Peeters
Posts: 11
Joined: Thu Nov 28, 2013 9:12 am

Re: Translation after rotation of a body

Post by Laura Peeters » Fri May 23, 2014 12:35 am

Hi Sherm,

Thanks for your quick reply! It was very usefull. Creating a massless body solved my problem. (Or at least this part ;) )

Regards,
Laura

POST REPLY