Programmatically restart simulation with different object poses
I am trying to create a reinforcement learning like simulation, where after each trial (episode) the simulation is restarted and the object pose is sampled from some initial pose distribution. I have tried to change the object pose by calling the /gazebo/set_model_state ROS service, but on the next simulation step, the pose changes back.
I have found a question that address the same issue that I have: http://answers.gazebosim.org/question... but it does not work for me. I have a model with a link connected through a fixed joint and when I try to detach and re-attach the joint, it still does not work - the hand gets back to the previous state. I have tried both Model::SetLinkWorldPose() SetLinkWorldPose() and Model::SetLinkWorldPose() (for the base link), but it did not prevent the behavior.
What would be the best way to do this? I am using Gazebo 7 with ROS.