Syntax for ros service with message type string array in request.
Hi, My service message looks like this.
string[] joint_names
---
bool ok
And advertised joint_service. From terminal I can call the service the with single joint but it appears that my syntax for multiple joints is wrong.
// single joint service call - succeeded
rosservice call /joint_service "joint_names:
- 'c1' "
Tried different way to call the service with multiple joints but nothing worked. Whats the correct syntax ?
// Nothing worked - service error
rosservice call /joint_service "joint_names:
- [' c1', 'c2'] "
rosservice call /joint_service "joint_names:
- '[c1, c2]' "
rosservice call /joint_service "joint_names: {['c1', 'c2'] }"
I would advise you to exploit the tab-completion that
rosservice call
supports.Something like this:
where
<tab-tab>
means: press <key>tab</key> twice. The correct syntax will then be shown to you.Yes, I am using tab completion
After which, i filled in joint c1 and its working fine. But not sure how to input multiple joints to the joint array.