Open DanielLSM opened 7 years ago
This might solve the problem of resetting the gazebo by calling a service to reset the gazebo world:
Going to add it in the wrapper.
As suggested doing:
rosservice call /gazebo/reset_simulation "{}"
brings the robot back to 90 degree (original) position
Freezing Gazebo (pausing physics) can be done with:
rosservice call /gazebo/pause_physics "{}"
Unpausing physics:
rosservice call /gazebo/unpause_physics "{}"
Programatically please do:
Imports:
from std_srvs.srv import Empty
In constructor:
self.srv = rospy.ServiceProxy ( '/service_name', Empty)
to call it from code:
rospy.wait_for_service ('/service_name')
self.srv()
I suggest to create a class out of it so that many services can be called with no code repetition.
We need to freeze Gazebo after calling each service, the ideia should be:
Details of another similar simulated environment https://github.com/openai/gym/wiki/Pendulum-v0