gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.18k stars 479 forks source link

Gazebo unstable and crashing #2593

Open osrf-migration opened 5 years ago

osrf-migration commented 5 years ago

Original report (archived issue) by Sietse Achterop (Bitbucket: SietseAchterop).


Hello List,

I have a (now simplified) model of a rower in a boat that keeps crashing or is very unstable. The code can be found in my github.

See the model in the file boot.xacro. There also is a boot.sdf that is generated from that, with only the ros_plugin removed so it can directly be run in gazebo.

Starting this model most of the time shows a wildly unstable behaviour, see this video.

If I change the shoulder joint to have 3 instead of 2 revolute joints, then the model crashes immediately, see this video.

I cannot find anything wrong with the model, all masses, inertias etc. are sane, so I only can conclude there is a bug here.

osrf-migration commented 5 years ago

Original comment by Sietse Achterop (Bitbucket: SietseAchterop).


The model now resides in directory testing in my github page. Please see the xacro-file, and a short video from gazebo.

I now really made the model as simple as possible, with 3 revolute joints, and it still crashes. E.g. the torso of the rower now consists of two links with a fixed joint. If I make the torso out of only one link then there is no crashing.

osrf-migration commented 5 years ago

Original comment by Sietse Achterop (Bitbucket: SietseAchterop).


Playing with damping and friction doesn't help much. Sometimes there also is the following message in the terminal

gzclient: /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/OgreMain/include/OgreAxisAlignedBox.h:252: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): Assertion `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' failed.

Hopefully this helps.

osrf-migration commented 5 years ago

Original comment by Sietse Achterop (Bitbucket: SietseAchterop).


I can make the model stable when I change the real time update rate to 3000, and the max step size to 0.00033. Also my complete model, including controllers, will be stable. But the real time factor drops to 0.25, even on a modern 12 core machine. What am I doing wrong. Am I really at the limit of what gazebo can do? My model has about 30 joints and also 30 basic links, nothing fancy. By the way, my current complete model can be found on my github page in the boot4_* directories.

osrf-migration commented 5 years ago

Original comment by Addisu Z. Taddese (Bitbucket: azeey, GitHub: azeey).


I took a look at your example (crash_boot.sdf) and I see that left_shoulder_xx_link has a really small mass and it's connected to other links that have a much larger mass. This results in a large inertia ratio across the joints, which is problematic in Gazebo with the default settings. I increased it's mass and MOI values by a factor of 10 and it was stable with step size of 0.001. Take a look at http://gazebosim.org/tutorials?tut=preset_manager&cat=physics to learn more about this issue. My suggestion would be to avoid small links as much as possible.

FYI, you would probably get more help if you post to http://answers.gazebosim.org/questions/

osrf-migration commented 5 years ago

Original comment by Sietse Achterop (Bitbucket: SietseAchterop).


Thank you very much for the reply, and sorry for the late response! I came here after getting no answers from gazebo/answers.

In my complete model there were 12 of those light links. I gave 8 of them 100 times more mass and the rest 10 times more mass. The model is now more or less stable with a time step of 0.0005. And half of the real time speed is acceptable for my purpose. But after between 1 and 10 minutes the model still crashes, but 1 minute is long enough for my experiments, so I can work with that.

I used this construct to e.g. create a shoulder with 3 degrees of freedom. Is there another way of creating a flexible shoulder/elbow/wrist without the stability issues? Thanks again, Sietse

osrf-migration commented 5 years ago

Original comment by Sietse Achterop (Bitbucket: SietseAchterop).


I am afraid there is more to it than large mass differences. I still had too much crashes to be workable so I investigated further.

Please see the example in https://github.com/SietseAchterop/Rowing/tree/master/test2.

It has 3 revolute joints and the links all have a mass of 1 kg. It always crashes as described earlier. Simplifying it further makes it stable most of the time.

For example, removing the fixed_joint/link between world and the first revolute joint makes it stable.

I currently use gazebo 9.6.0 with default settings. Reducing the time step to 0.0005 makes it stable, but this is such a simple model that I only can classify it as a bug.

Please help.

osrf-migration commented 5 years ago

Original comment by Sietse Achterop (Bitbucket: SietseAchterop).


With help from gazebo/answers I now have a solution: use the DART physics engine. That works perfectly for me.

The joint damping was set very high in an attempt to battle the instabilities, but somehow it had the opposite effect. Strange. Lowering the damping made the simple model (test2) work, but more complicated models still become unstable or crash.

But there still is an issue with using ODE it think. Bullet behaves the same as ODE by the way.