Ask Your Question

Controller makes robot unstable in Gazebo

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

dbworth gravatar image

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

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 imageAdolfo Rodriguez T ( 2012-09-07 02:49:13 -0600 )edit

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

dbworth gravatar imagedbworth ( 2012-09-09 06:06:50 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

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

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

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 1,165 times

Last updated: Sep 09 '12