Gazebo: no friction, no self collide (self collision not working)
I've been fiddling for a long time, trying to control a model in Gazebo.
After tweaking the ODE settings and setting controller parameters to zero, I think I've found the underlying problem: my simulation has no friction or self collision.
The robot spawns in this position:
and should just sit there under the influence of gravity.
However, the tiny wrist link falls down (arrow 1), because the controller is disabled, and passes through the link below, which suggests that SelfCollision it not working:
Then the forearm rotates (label 2) and the whole think flops to the ground.
If I remove everything beyond the elbow, the elbow rotates to its limit, and the small link keeps swing back and forth (see red arrow) like something in a horror film!
In the URDF, example settings for a joint are:
<gazebo reference="joint"> <dynamics damping="0.0" friction="100.0"/> </gazebo> <gazebo reference="link"> <selfCollide>true</selfCollide> <static>false</static> <turnGravityOff>false</turnGravityOff> </gazebo>
I tried adding some damping, and setting friction really high, but there's no change.
Joint controllers are disabled e.g:
robot/controller/joint: type: robot_mechanism_controllers/JointPositionController joint: jointname pid: p: 0.0 i: 0.0 d: 0.0 i_clamp: 0.0
Gazebo ODE settings in world file are:
<physics type="ode"> <gravity xyz="0 0 -9.8"/> <ode> <solver type="quick" dt="0.001" iters="500" sor="1.3"/> <constraints cfm="0.0" erp="0.1" contact_max_correcting_vel="10.0" contact_surface_layer="0.001"/> </ode> </physics>
If I change the "dt" or "iters" values, it just makes the same thing happen faster or slower in simulation.
If I click on the links in Gazebo, SelfCollide is set to true.
Also, when Gazebo loads, it prints a warning:
[ WARN] [1347205553.791454857, 0.002000000]: multiple inconsistent <selfCollide> exists due to fixed joint reduction, overwriting previous value [false] with [true].
I can't find where it thinks I've set SelfCollide to false? is it something to do with the mechanism configuration?
but nevertheless, it says it's been set to "true".
Are these things meant to be working?
Thanks for your help.