Why does the robot links fall downwards when gravity is disabled and no controllers are used?

asked 2016-04-06 05:18:46 -0600

SP gravatar image


I have a model for a robotic arm which I want to move to arbitrary positions by applying random torques on each joint. For this purpose, I have written a service client which calls the ros service ApplyJointEffort. Each effort is applied for a duration of 10s. Now, the problem is I want to maintain each joint at exactly the same position it reached to after the application of the efforts. This works fine for joints which move in the x-y plane, and such a joint stays in the position to which it was driven by the last applied torque. However, the joints which allow motion in the z direction are creating problem, as the links associated with such joints gradually start falling downwards. My initial suspicion was that gravity is the culprit, so I had set gravity to false for all such links. I have also set gravity in all 3 dimensions to 0 in the physics properties. Still, this problem persists, which leads me to believe that somehow gravity is still doing its trick somewhere

Actually, on spawning the robot, its arm its in the vertical position but without controllers and with gravity disabled, again the arm links start drifting downwards. As per my reasoning it should not happen. With controllers the robot maintains its initial vertical position of the arm, but then I suppose seeing the effect of the applied torques will be more difficult, as each time a joint angle changes due to an applied effort, immediately the controller pushes it back to the initial position.

How to check whether gravity is truly disabled or not? Also, is there any way to maintain the joint positions by modifying the controllers? When I interface moveit with gazebo using the same controllers, after each trajectory execution, the robot stays at the new position, and does not return to its initial position. Then why does it not allow the new positions to persist in case of applied torques? Please guide me as to where I am going wrong, and how to achieve the said objective, as I am a beginner in gazebo and ros.


edit retag flag offensive close merge delete


How are you disabling gravity? Is it through the SDF description or are you setting gravity to zero after the simulation has already started?

chapulina gravatar imagechapulina ( 2016-04-06 10:45:58 -0600 )edit

recommendation: 1) test if gravity is active without the controller. 2) if 1 works, the problem is in the controller. otherwise 3) update question to contain a world or model file that does not have the controller, with gravity turned off, yet gravity is still active.

hsu gravatar imagehsu ( 2016-04-06 13:46:56 -0600 )edit

1) Where did you get the model of the arm? It may have a plugin attached that is doing things behind the scenes (like enabling or simulating gravity) that you wouldn't have control over. 2) On another note, you should set up a feedback loop (e.g. PID) to control the position of the arm. This will make sure your arm stays in the same place even with external disturbances (like gravity, or like somebody walking up to your arm and pushing it sideways).

pcdangio gravatar imagepcdangio ( 2016-04-13 12:52:14 -0600 )edit