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

How to specify default arguments in a Service or Action

asked 2016-05-03 21:33:59 -0600

Cerin gravatar image

Is it possible to define default arguments in a Service or Action message? I want to expose several options in services and actions, but it seems by default, ROS makes all fields required. How do you specify defaults?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-05-04 00:50:27 -0600

ahendrix gravatar image

The ROS message, service and action formats do not allow you to specify defaults for any of the fields.

It may be better to expose several services, or you may want to write a C++ or python wrapper class around the service or actionlib client that provides the defaults.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-05-03 21:33:59 -0600

Seen: 1,222 times

Last updated: May 04 '16