ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Controller makes robot unstable in Gazebo

asked 2012-09-07 01:47:33 -0500

dbworth gravatar image

updated 2014-04-20 14:06:44 -0500

ngrennan gravatar image

Fuerte, Gazebo 1.6.16

Hi all, I've setup a robot model in a world. I start the simulation paused and everything is ok, but when I press 'play' the controller won't hold the robots position.

From it's resting position, it actually jiggles a bit then flops the links to one side. I've tried adjusting the parameters... I wonder if my robot's mass is too light. The measurements are accurate, but being in meter units the inertia matrix is very small for each link.

e.g. for one link:

    <mass value="0.5692" />
    <origin xyz="-0.000000157 0.014876512 0.044359344"/>
    <inertia ixx="0.001427609768" ixy="-0.000000003731" ixz="0.000000282945" 
                                  iyy= "0.000797193532" iyz="0.000106505679" 
                                                        izz= "0.001191235228" />

I'm using the robot_mechanism_controllers/JointPositionController controller for each joint, with:

    p: 2.0
    i: 0.0
    d: 0.5
    i_clamp: 0.0

Gazebo settings in the URDF are

<dynamics damping="1.0" friction="1.0"/>


Do I need to set these other parameters?:

<initial_joint_position>    ?
<stopKd value="1.0" />   ?
<stopKp value="1000000.0" />   ?

World settings are:

<physics type="ode">
  <gravity xyz="0 0 -9.8"/>
    <solver type="quick" dt="0.001" iters="10" sor="1.3"/>
    <constraints cfm="0.0" erp="0.1" contact_max_correcting_vel="10.0" contact_surface_layer="0.001"/>

This is so frustrating...

Thanks for your help.

edit retag flag offensive close merge delete


Is the dynamics element that of a joint? If so, try lowering substantially the damping value. The same goes for the d gain in the controller.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2012-09-07 02:49:13 -0500 )edit

Thanks Adolfo Rodriguez T that does help calm things down...

dbworth gravatar image dbworth  ( 2012-09-09 06:06:50 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2012-09-07 04:58:56 -0500

hsu gravatar image

First isolate source of instability by setting

  p: 0
  i: 0
  d: 0
  i_clamp: 0


<dynamics damping="0.0" friction="0.0"/>


<physics type="ode">
  <gravity xyz="0 0 -9.8"/>
    <solver type="quick" dt="0.0001" iters="1000" sor="1.3"/>
    <constraints cfm="0.0" erp="0.1" contact_max_correcting_vel="10.0" contact_surface_layer="0.001"/>

Then, change back the parameters one by one, and see which one(s) are the culprit of your instability.

edit flag offensive delete link more


Thnak you, I was having this problem with my robot collapsing after unpausing gazebo. It turns out, I had changed damping from 0.0 to 0.7, which caused the physics engine to fail. Setting it to 0.01 made it work again.

LasseBoerresen gravatar image LasseBoerresen  ( 2018-12-28 16:41:00 -0500 )edit

answered 2012-09-09 06:11:21 -0500

dbworth gravatar image

Thanks hsu this help me find the underlying problem, which seems to be that my model has no friction or self collision.

Originally, when I disabled the controller, the model would spawn and sit in place. Now it spawns, links pass through each other and it rolls and flops onto the ground:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-09-07 01:47:33 -0500

Seen: 4,606 times

Last updated: Sep 09 '12