Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Properly restarting the gazebo simulation for iterative learning

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 well...at 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.

Properly restarting the gazebo simulation for iterative learning

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 well...at 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.

Properly restarting the gazebo simulation for iterative learning

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 well...at 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.