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

Revision history [back]

click to hide/show revision 1
initial version

Isn't /gazebo/reset_models a service, not a topic?

Isn't /gazebo/reset_models a service, not a topic?


I am sorry, could you please help me by telling what should I type into my for loop in order to get the model poses reset?

I don't know about "get model poses reset", but for invoking the /gazebo/reset_simulation service, the following should work:

from std_srvs.srv import Empty

# maybe do some 'wait for service' here
reset_models = rospy.ServiceProxy('/gazebo/reset_simulation', Empty)

# invoke
reset_models()

See also the Writing a Simple Service and Client (Python) tutorial, specifically the Writing the Client Node section.

Isn't /gazebo/reset_models a service, not a topic?


I am sorry, could you please help me by telling what should I type into my for loop in order to get the model poses reset?

I don't know about "get model poses reset", but for invoking the /gazebo/reset_simulation service, the following should work:

import rospy
from std_srvs.srv import Empty

# maybe do some 'wait for service' here
reset_models = rospy.ServiceProxy('/gazebo/reset_simulation', Empty)

# invoke
reset_models()

See also the Writing a Simple Service and Client (Python) tutorial, specifically the Writing the Client Node section.

Isn't /gazebo/reset_models a service, not a topic?


I am sorry, could you please help me by telling what should I type into my for loop in order to get the model poses reset?

I don't know about "get model poses reset", but for invoking the /gazebo/reset_simulation service, the following should work:

import rospy
from std_srvs.srv import Empty

# maybe do some 'wait for service' here
reset_models reset_simulation = rospy.ServiceProxy('/gazebo/reset_simulation', Empty)

# invoke
reset_models()
reset_simulation()

See also the Writing a Simple Service and Client (Python) tutorial, specifically the Writing the Client Node section.