16 from __future__
import print_function
18 from std_srvs.srv
import Empty
23 if __name__ ==
'__main__':
24 rospy.init_node(
'unpause_simulation')
26 if rospy.is_shutdown():
27 rospy.ROSException(
'ROS master is not running!')
30 if rospy.has_param(
'~timeout'):
31 timeout = rospy.get_param(
'~timeout')
33 raise rospy.ROSException(
'Unpause time must be a positive floating point value')
35 print(
'Unpause simulation - Time = {} s'.format(timeout))
37 start_time = time.time()
38 while time.time() - start_time < timeout:
43 rospy.wait_for_service(
'/gazebo/unpause_physics', 100)
44 unpause = rospy.ServiceProxy(
'/gazebo/unpause_physics', Empty)
45 except rospy.ROSException:
46 print(
'/gazebo/unpause_physics service is unavailable')
50 print(
'Simulation unpaused...')