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

Since the service call takes very less time to execute the command. I added an extra line for rospy to wait till the service is again available but just this line without adding a time like around 5 sec wasnt working.

rospy.wait_for_service('/gazebo/set_model_state', 5.0)

After adding this line my error vanished and am able to execute things as I want them to. To prevent future errors i also added a try, except statements while doing the service call.

Since the service call takes very less time to execute the command. I added an extra line for rospy to wait till the service is again available but just this line without adding a time like around 5 sec wasnt working.

rospy.wait_for_service('/gazebo/set_model_state', 5.0)

After adding this line my error vanished and am able to execute things as I want them to. To prevent future errors i also added a try, except statements while doing the service call.

Since the service call takes very less time to execute the command. I added an extra line for rospy to wait till the service is again available but just this line without adding a time like around 5 sec wasnt working.

rospy.wait_for_service('/gazebo/set_model_state', 5.0)

After adding this line my error vanished and am able to execute things as I want them to. To prevent future errors i also added a try, except statements while doing the service call.

Though this doesn't answer the asked question this provided me with a quick fix to work with.