Nested joints: how to associate both a prismatic and a revolute joint to an object

Typically: "How do I... ", "How can I... " questions
Post Reply
gvgramazio
Posts: 18
Joined: 23 Feb 2018, 14:46

Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by gvgramazio »

I want to have a dynamic respondable shape that is attached to another shape through a joint that permits both translation and rotation. Both translation and rotation are with respect to the same axis. Since such joint doesn't exist I nested a prismatic joint inside a revolution joint. However, if I don't put another dynamic respondable shape in between it doesn't work. What is the right way to obtain what I want?

This is ok:

Code: Select all

Static_shape
|- revolute_joint
  |- dynamic_respondable_shape
This is also ok:

Code: Select all

Static_shape
|- revolute_joint
  |- dynamic_respondable_shape
    |- prismatic_joint
      |- dynamic_respondable_shape
This is not ok (and I don't know why):

Code: Select all

Static_shape
|- revolute_joint
  |- prismatic_joint
    |- dynamic_respondable_shape

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by fferri »

You cannot have a joint as a direct child of another joint.

The way you did it (with a body inbetween) is the way to do it.

See Designing dynamic simulations.

gvgramazio
Posts: 18
Joined: 23 Feb 2018, 14:46

Re: Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by gvgramazio »

However, in the various example I saw the structure is like:

Code: Select all

Static_shape
|- Revolute_joint
  |- Dynamic_respondable_shape_1
    |- Prismatic_joint
      |- Dynamic_respondable_shape_2
with Dynamic_respondable_shape_1 different from Dynamic_respondable_shape_2. In my case, I have to put them equal to each other. Cannot I use something like a dummy shape instead of Dynamic_respondable_shape_1? The design is terribly redundant and I thought that there is a better way to do it.

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by fferri »

The two shapes cannot be equal.

Probably what you want is to have the first shape to be an invisible primitive shape (i.e. a sort of "dummy").

gvgramazio
Posts: 18
Joined: 23 Feb 2018, 14:46

Re: Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by gvgramazio »

Probably is better to explain what I want in term of simulation and ask for the better way to achieve that.

I have an object with a cylindrical hole and another object that has a cylindrical shape. The second object should be able to rotate and translate through the hole.

Since the first object is non-convex, my idea was to make the first one with a primitive shape and add as a child the shape with the hole. Then nest two joints and add as a child the second object, the one with the cylindrical shape. The dynamic shape of the first object and the second object are respondable and dynamically enabled. Of course, the respondable masks of the two don't overlap in order to avoid a collision. In the end, my first try is:

Code: Select all

Primitive_shape1_dyn
|- Convex_shape (First object with a cylindrical hole)
|- Revolute_joint
  |- Prismatic_joint
    |- Primitive_shape2_dyn (Second object with a cylindrical shape)
Of course, this doesn't work because, as you said, I cannot have a joint right inside another one.

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by fferri »

You have to add an object between the two joints, such that it becomes child of joint1 and parent of joint2.

RobAtLab
Posts: 92
Joined: 10 Jan 2018, 17:49

Re: Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by RobAtLab »

You can make the object to go between the joints visually invisible and dynamically non-respondable. You still need to give it a mass and moments of inertia but otherwise it can bne like its not there at all. The joints can be co-located in space, an object can go between things in a hierachy without too much worry about physical positioning in space. In your situation, as of Post 14:27 on 10th Sept, I'd put a cube between the revoluate joint and the prismatic in the hierachy, I'd make the cube visually invisible and make sure it is non-respondable (that way it can't hit anything by acident but it does still need to be dynamic to allow movement), I'd give it the same position in space as the centre of the revolute joint. Then I'd add the prismatic joint as it's child, having yet again the same position in space as the revolute.

gvgramazio
Posts: 18
Joined: 23 Feb 2018, 14:46

Re: Nested joints: how to associate both a prismatic and a revolute joint to an object

Post by gvgramazio »

Thanks for your reply. The fact is that even if I set the object as invisible and non-respondable (to avoid collisions) it would still be dynamic. This means that it will have a mass and an inertia thus influencing my system. Of course, I could set it with very low value but still, I don't like this workaround.

Post Reply