What's the correct syntax for performing a service call from the command line in ROS2 ?
Consider the following service, defined in `example_interfaces` package
AddTwoInts.srv
int a
int b
---
int c
Assuming that the server is called `"add_two_ints"`
I managed to pass one argument to the service call in the following way
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1'"
requester: making request: example_interfaces.srv.AddTwoInts_Request(a=1, b=0)
How to pass also the second argument ?
These are not working
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1'b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1' b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1', b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a:'1'" "b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a:'1'", "b:'2'"
Trending Articles
More Pages to Explore .....