Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable spawn entity wait for service timeout #1072

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gazebo_ros/scripts/spawn_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def __init__(self, args):
Default is without any namespace')
parser.add_argument('-robot_namespace', type=str, default=self.get_namespace(),
help='change ROS namespace of gazebo-plugins')
parser.add_argument('-timeout', type=float, default=30.0,
help='Number of seconds to wait for the spawn entity service to \
become available')
parser.add_argument('-unpause', action='store_true',
help='unpause physics after spawning entity')
parser.add_argument('-wait', type=str, metavar='ENTITY_NAME',
Expand Down Expand Up @@ -234,7 +237,7 @@ def entity_xml_cb(msg):
# Unpause physics if user requested
if self.args.unpause:
client = self.create_client(Empty, '%s/unpause_physics' % self.args.gazebo_namespace)
if client.wait_for_service(timeout_sec=5.0):
if client.wait_for_service(timeout_sec=self.args.timeout):
self.get_logger().info(
'Calling service %s/unpause_physics' % self.args.gazebo_namespace)
client.call_async(Empty.Request())
Expand Down