Gazebo | Ignition | Community
Ask Your Question

Can we lock or freeze a moving joint?

asked 2013-12-19 01:10:12 -0500

peshala gravatar image

Hi all,

I want the wheels of a mobile robot to lock, say on some given command, so that there is no need to run the wheel controllers, and upon an unlock command to go back to usual behavior. I saw in DRC that there is a freeze functionality. So, I was wondering whether this is possible or not.

Thank you


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-12-19 18:24:40 -0500

scpeters gravatar image

You can do this programmatically using the physics API if you have a pointer to the Joint object. See the Joint::SetHighStop and Joint::SetLowStop commands. There is an example of using these commands in one of the physics tests (test/integration/

So my approach would be to get a pointer to the joint object, read the current joint position, then set the joint limits to be equal to the current position.

gazebo::physics::JointPtr joint;
joint = getTheJointPtrSomehow();
// Get the current joint position
gazebo::math::Angle currentPosition = joint->GetAngle(0);
joint->SetHighStop(0, currentPosition);
joint->SetLowStop(0, currentPosition);

That's how I would do it currently. It would be nice to have an API that would do this automatically. Please make a feature request on the bitbucket issue tracker if you have an idea for how you would like it to work.

edit flag offensive delete link more


Thanks for your answer @scpeters I will try this and make a feature request.

peshala gravatar imagepeshala ( 2013-12-20 02:09:40 -0500 )edit

and when we need to revert back to the original controller we can set: joint->SetHighStop(0, gazebo::math::Angle(10000000000000000)) where 1E16 being the default value set by gazebo for a continuous joint

peshala gravatar imagepeshala ( 2013-12-20 20:55:09 -0500 )edit

Question Tools

1 follower


Asked: 2013-12-19 01:10:12 -0500

Seen: 2,628 times

Last updated: Dec 19 '13