## Contrain motion to certain DOF

Typically: "How do I... ", "How can I... " questions
xli4217
Posts: 11
Joined: 13 Oct 2015, 21:08

### Contrain motion to certain DOF

Hi, as per the title, I was wondering if there's a quick way to constrain the motion of my robot to say only move in the z direction and fix the other 2 translational and 3 rotational DOFs.

Thank you

coppelia
Posts: 7838
Joined: 14 Dec 2012, 00:25

### Re: Contrain motion to certain DOF

Hello,

it depends on what type of simulation you have. I guess you are having a dynamic simulation. In that case, you will have to use additional masses/joints to constrain the movement of your dynamic object/model.

Imagine you have a humanoid robot, with a hirarchy like:

Code: Select all

torso --> leftLegJoint1 --> ...
--> rightLegJoint1 --> ...
--> ...
If you want to forbid rotation and keep the robot in a vertical plane (i.e. only being able to walk forward/backward), then you have 2 possibilities:

1. Use 2 auxiliary joints and masses:

Code: Select all

anchor --> prismaticJoint1 --> auxMass1 --> prismaticJoint2 --> torso
2. Use 1 auxiliary joint and mass:

Code: Select all

anchor --> sphericalJoint --> torso
The second solution works better since simpler, but the robot will walk in a circle motion around the spherical joint. If you put the spherical joint very far from the torso, then it could appear as walking in a straight motion.

Have a look at this video that uses technique number 2.

Cheers

horsefacelee
Posts: 27
Joined: 15 Jun 2016, 00:34

### Re: Contrain motion to certain DOF

I wonder does the anchor means floor?
like the "resizableFloor when we build the model?

Also, how can you define a spherical joint between robot and floor while that robot could still move freely? I tried and it looks like there is a fix radius between robot and the joint.

coppelia
Posts: 7838
Joined: 14 Dec 2012, 00:25

### Re: Contrain motion to certain DOF

Yes, the anchor could be the floor. At least a static shape.
And yes, if you use the simpler version with a spherical joint, then your robot would walk around the spherical joint in a circular movement.
But if you use two prismatic joints as described further up, then your robot could walk constrained in a plane.

Cheers