Closed damien-robotsix closed 5 months ago
There's already a topic_namespace_prefix
for that. You can pass that to the Mode
's constructor.
That said I'm not sure whether that's the best solution though.
Ho, my bad, I was too fast on this, I didn't see the topic prefix in the constructor.
However that breaks the ability to set the namespace using ROS arguments when running the mode Node.
Anyway both approaches are compatible. With this PR, you can:
How does that sound?
However that breaks the ability to set the namespace using ROS arguments when running the mode Node.
That is correct. It's separate, as someone might want to write a node that controls/consumes telemetry from multiple vehicles.
Anyway both approaches are compatible. With this PR, you can:
I'm fine with both approaches, just the default needs to work with the PX4 default, independent from the node name. Which looks like it's the case here, right?
It will if the node has no namespace (default in ROS2)
Thanks for merging :)
Currently the library do not take into account the namespace if specified. The micro DDS client allows in PX4 to configure a custom namespace (multiple drones on the same network). To reflect this, it would be good to also allow this library to use custom namespaces. Removing "/" in front of topic definitions solve this. The topics will reflect the chosen namespace for the node.