Gazebo | Ignition | Community
Ask Your Question

Properly restarting the gazebo simulation for iterative learning

asked 2016-09-21 15:32:28 -0500

curranw2 gravatar image

updated 2016-09-23 13:00:47 -0500

I've seen this question posted many times, but with no definitive answer (and they are old). To name a few:

1 2 3

However, many of these solutions don't really answer the question. reset_world seems to break all of the controllers. Just calling it with the pr2 model leads to a flow of red errors.

What I'm using now is the SetModelConfiguration service call. This works the beginning. However, after the 10th or so experiment, the robot arm beings to "fling around" after the service call. After 20 or so experiments, the whole robot starts rocking as it gets called. It's as if the model is colliding with itself. I'm wondering why this is.

Thoughts: Could it be the effort controller? To test this I set all of the efforts to 0 between experimental runs, and give the controllers a second or two to settle before calling SetModelConfiguration. This didn't help.

Is gazebo storing some sort force? It seems like the controller would remove that. I use the "/gazebo/clear_body_wrenches" and the "/gazebo/clear_joint_forces" service calls to reset all forces, but that doesn't help either.

I'm out of ideas! I'm using gazebo for ROS (obviously), but I believe this may be an underlying gazebo issue, and may have a gazebo solution.

Here is a video showing when I use "SetModelConfiguration" 10 times with the same joint angles. Eventually it settles. I am giving no motor commands at this point, it's simply where the arm "settles" after resetting the joints.

Edit: This problem exists specifically with armed robots. Robots with just a base seem to work just fine.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-09-26 16:19:18 -0500

curranw2 gravatar image

Installing the newest version of gazebo fixed this issue entirely. Gazebo 7 works great.

edit flag offensive delete link more

answered 2016-09-22 09:10:34 -0500

nzlz gravatar image

updated 2016-09-24 03:10:31 -0500

You have an example here : If you are using iterative learning I recommend you to use the toolkit and follow that code structure.

edit flag offensive delete link more


That link seems to be broken, but if it's the project I think you're talking about, it uses a turtlebot. A turtlebot is great, since it has no arms/joints and you can just reset the whole simulation. My issue occurs specifically with armed robots (I've tried multiple). I'll modify my question.

curranw2 gravatar imagecurranw2 ( 2016-09-23 13:00:07 -0500 )edit

If you don't spawn the robot again each iteration, all the small computation errors that have to do with the model will will create a larger error at the end. I don't think iterative learning is viable in gazebo if you don't at least update the pose of the robot manually.

nzlz gravatar imagenzlz ( 2016-09-24 03:41:20 -0500 )edit

Question Tools



Asked: 2016-09-21 11:50:21 -0500

Seen: 4,670 times

Last updated: Sep 26 '16