Rosbridge get topic type [closed]
I am using rosbridge 2.0 to communicate with ROS over websocket. I use call_service
and /rosapi/topics
to get a list of current topics in ROS, which works fine. Now I would like to get the topic types of each topic available in this list, and for this I use call_service
and /rosapi/topic_type
to loop through each entry in the topics list.
However, because of the sparse examples I have a hard time getting the syntax right. If I just call call_service
and /rosapi/topic_type
rosbridge_server returns an error: service [/rosapi/topic_type] responded with an error: error processing request: , most likely because it needs an argument for what topic I would like the type returned for.
From https://github.com/RobotWebTools/rosbridge_suite/blob/groovy-devel/ROSBRIDGE_PROTOCOL.md I have the following options below, but have not found the correct syntax yet to return the topic type:
3.4.6 Call Service
{ "op": "call_service",
(optional) "id": <string>,
"service": <string>,
(optional) "args": <list<json>>,
(optional) "fragment_size": <int>,
(optional) "compression": <string>
}