Specify services and topics for rosbridge #985
-
I'm using humble version of rosbridge. I'd like to whitelist topics and services for my rosbridge in the ros2 python launch file. There is one XML launch file here https://github.com/RobotWebTools/rosbridge_suite/blob/humble/rosbridge_server/launch/rosbridge_websocket_launch.xml so I inlcude the XML launch file in the ros2 python launch file. I think we need to specify
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need to pass the paramater as this: topics_glob = "'topic_a'",'topic_b','topic_c'"
services_glob = "'service_a','service_b','service_c'" This where the params are being parsed in the rosbridge script: This helper function can convert an array of strings into the glob param for rosbridge in your launch file: def parse_globs(globs: list[str]) -> str:
return ",".join([f"'{glob}'" for glob in globs]) |
Beta Was this translation helpful? Give feedback.
You need to pass the paramater as this:
This where the params are being parsed in the rosbridge script:
rosbridge_suite/rosbridge_server/scripts/rosbridge_websocket.py
Line 282 in 7cd26b5
This helper function can convert an array of strings into the glob param for rosbridge in your launch file: