# how to stop the joint motion( clear the force)

I have set a force on the shoulder of simple_arm and it seems that It is going to move forever until I stop it somehow.

How can I clear/stop the force that I have set by Joint::SetForce() on a joint? In general how can we stop the motion of a model in programming. Is there any function to stop the model?

edit retag close merge delete

Sort by ยป oldest newest most voted

Where in you'r code have you applied the force ? are you absolutely sure it is not in the onUpdate() or similar never ending call ?

What is the purpose?

have you got friction in the joint ? according to newtons laws of motion, the arm will continue to rotate forever, unless something provides a reaction force, like friction.

if you apply the force in a small duration of time, the turnrate of the arm will after that moment in time become constant. With frictions it will decellerate, with repeated force the arm will accellerate. with repeated force and friction the arm will reach a steady state where you'r applied force equals the force from friction, and from here the speed will eventually become constant.

solutionset:

1. if you are repeatingly applying force, stop that after some time and let the friction stop the arm (use gazebos simulation time..)

2. learn control theory, (and basic physics) and let a controller that calculate the desired force to have the arm move to a position or speed or both be implemented. (You should do this to control the HW anyway)

3. stop using forces, cheat and use the animation interface for gazebo

more

i have the same kind of problem ,i tried to modify the c++ code in tutorial http://gazebosim.org/wiki/Tutorials/1.3/control_robot/mobile_base_laser .it also not stopping.i have setForce to zero even it is not stooping .I am beginner in field of robotics as well as in gazebo .plz guide me ,i am attachin my modified code here

( 2013-07-30 15:49:01 -0600 )edit

double target_dist = 2.0;

   if (min_dist &lt; this-&gt;laser-&gt;GetRangeMax())
{

double torque = this-&gt;gain *( (min_dist - target_dist)*0.1 );

this-&gt;leftWheelJoint-&gt;SetForce(0, torque);
this-&gt;rightWheelJoint-&gt;SetForce(0, torque);
}

else


{

this->leftWheelJoint->SetForce(0,0.0); this->rightWheelJoint->SetForce(0,0.0); }

( 2013-07-30 15:51:34 -0600 )edit

as i can't paste my complete code here i just paste the part which i had modified .

( 2013-07-30 15:53:35 -0600 )edit

Do you guys install perf using following commands and it works for you?

Install perf sudo apt-get install linux-tools Record data perf record gzserver worlds/pr2.world Generate a report perf report

more

i m begginer in gazebo but i solved the problem using SetDamping().if too obvious its k ,i just tell how i done in my case.

more