Respawn/Move robot in Gazebo [closed]
I have a complex robot that I'm simulating in Gazebo. It's currently running 5 hokuyo laser scanners, an IMU, a prosilica camera, and two custom joint controllers for the wheels and the pan/tilt of the camera. The current goal is simply to be able to move the robot back to the starting position in Gazebo without having to restart the entire simulator.
The first thing that I tried was simply to use the service set_model_state
to set the robot back to the start. This didn't work because it causes the robot to fly off into space immediately after the service returns.
The second method was to delete the model and respawn it. To do this, I first stop all of my custom controllers, unload them, and then delete the model. This all works fine. The next step is to spawn the robot again, then restart the controllers. This works, but I've just noticed that every time I do this, it increases the memory usage of Gazebo. I feel as if Gazebo is failing to unload some of the sensor plugins on the robot (hokuyos, etc.).
So my question, has anyone accomplished this before? If anyone has any ideas, or knows anything about this memory problem, I would greatly appreciate the help. Thanks.