In my word, client send a data called service. (Request)
server does a certain behavior.
And return the result to client. (Response)
ros2 interface show example_interfaces/srv/AddTwoInts
// request
int64 a
int64 b
---
// response
int64 sum
It directly send request via CLI.
// this is an error
ros2 service call /add_two_ints example_interfaces/srv/AddTwoInts "{a:3, b:4}"
// this works (There should be space after ":")
ros2 service call /add_two_ints example_interfaces/srv/AddTwoInts "{a: 3, b: 4}"
ros2 node info {your node}
#: You can check all service, topics.
ros2 service list
ros2 service type {your service}
ros2 interface show {your service type}
#: shows response and request format
ros2 service call {your service} {your service type} **[Press tab, then you can see list of possible cmd]**
rqt -plugins - service caller : you can give request much easier, and you can check response on the bottom.