# Setting force to joint? not torque?

Why can't gazebo set torque to joint? I couldn't find "SetTorque" command for joints. Actually, I cannot understand what "setting force to joint" means. For example, SetForce(0, 1) means generating 1N to a given joint. Does that mean the joint can apply 1N to its loads no matter how big the loads are? I think joint effort should be described as torque...

The reason that I'm asking is that I'm simulating some passive torsional spring-damping joints. Thanks to the answers of this question (http://answers.gazebosim.org/question/217/simulating-springs/), I was able to design those by using

springjoint->SetForce(int _index, (rest_angle-current_angle)*stiffness);


However, stiffness unit of torsional spring is N-m/rad and the unit doesn't match with force. Please clarify what SetForce of joint exactly means in real physics?

edit retag close merge delete

Sort by ยป oldest newest most voted

Setting the force actually applies a torque to the joint.

Here is the API documentation, which is a bit unclear. We used the "Force" terminology in an effort to encompass both prismatic joints and rotational joints.

The underlying call (assuming you're using ODE) is dJointAddHingeTorque.

more

Thank you for the clarification. I think it would be nice if you can add some comments about this in the API docs including the units (N, Nm and etc.). Actually, according to this question and its answer (http://answers.gazebosim.org/question/1850/how-to-use-torque-to-control-joint/), it is very easy to confuse like me.

( 2014-02-20 11:39:11 -0500 )edit

By the way, during searching some answers to my question, I found "SetDamping" and it looks like doing what I'm doing with SetForce in the question. After searching in bitbucket.org/osrf/gazebo, the SetDamping seems to set CFM to joints. Is that right? According to API, it sounds like it is for applying just damping coefficient not with spring coefficient. It will be appreciated if you can clarify this. I always thank you for answering my questions.

( 2014-02-20 11:45:50 -0500 )edit

SetDamping makes the joint behave viscously damped. The coefficient for rotary joints will have units of torque / rate or (N m / (rad / s)). For prismatic joints, force / rate or (N / (m/s)).

( 2014-02-20 11:56:43 -0500 )edit

## Stats

Seen: 3,903 times

Last updated: Feb 20 '14