Looking for a stable solution to reset a robot (with controller) in Gazebo
Hey,
I think the problem is known to almost everyone, but here again the problem description: The position of a robot should be reset to a defined position, e.g. the start position of all joints defined in the launch file.
A simple service call with '/gazebo/reset_world' nor '/gazebo/reset_sim' wouldn't do the trick. Note: I'm aware of the famous github issue #93 and the pause/unpause solution is at least a stable one.
My best solution so far:
- restart all controllers
- pause
- set pose via '/gazebo/set_model_configuration'
- update the controllers "desired positions" via FF topic command: '/controller_ns/command'
- unpause
- for good measure a repeat of 4.
Most of the times this works well and seems to work fast as well, but sometimes one ore more joints seems to be lost and flattering around without any control. The topics show the error position and error velocity, but 0 acceleration and 0 effort (for joint effort controllers). From this point on, it can't recover to a good and clean reset, it will always lost the same joints.
What is this black magic trickery and how can i avoid it? Is it better to delete the robot and spawn it again?