ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

how to call pause_physics service

asked 2013-03-24 14:39:37 -0500

mugetsu gravatar image

updated 2013-04-28 23:17:16 -0500

ipso gravatar image

i cant seem to do:

pause_physics_client=rospy.ServiceProxy('/gazebo/pause_physics',PausePhysics)

there doesn't seem to be a PausePhysics.srv anywhere under gazebo_msgs/srv

I can see that the service is running in rosservice list, and I'm using groovy.

What should I be doing instead? All I want is a way to toggle physics inside my code.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-03-26 03:02:19 -0500

gazebo/pause_physics is an Empty service (no inputs or output arguments), so doesn't need its own service definition. See this section from the wiki page:

~/pause_physics (std_srvs/Empty)
    Pause physics updates. 

~/unpause_physics (std_srvs/Empty)
    Resume physics updates.

Try this and see if it works:

from std_srvs.srv import Empty
pause_physics_client=rospy.ServiceProxy('/gazebo/pause_physics',Empty)

If you need it, gazebo/unpause_physics is also an Empty service.

edit flag offensive delete link more
-1

answered 2018-09-13 14:52:03 -0500

Markus gravatar image
from std_srvs.srv    import Empty, EmptyRequest  
pause_physics_client=rospy.ServiceProxy('/gazebo/pause_physics',Empty)
pause_physics_client(EmptyRequest())
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-24 14:39:37 -0500

Seen: 1,839 times

Last updated: Sep 13 '18