ros2 / launch_ros

Tools for launching ROS nodes and for writing tests involving ROS nodes.
Apache License 2.0
58 stars 72 forks source link

feat: Adding a prefix option to node launch #398

Closed wkaisertexas closed 3 months ago

wkaisertexas commented 3 months ago

Feature request

Feature description

Adding an extra parameter to the Node class to launch and executable with a specified prefix.

https://github.com/ros2/launch_ros/blob/8751ff4cd9060157831dcaeecd89611932aec608/launch_ros/launch_ros/actions/node.py#L112-L240

From what I can tell, this was a feature in ros which allowed a prefix to be specified which is launched ahead of the executable.

Implementation considerations

Potentially this feature could also be implemented with ComposableNodes API, however implementation and the use case there are a bit more vague.

Currently, I am using Node(executable=f"{prefix} {executable}") as a workaround, but this does not seem ideal.

clalancette commented 3 months ago

I think we have this already in Launch; see http://docs.ros.org/en/jazzy/How-To-Guides/Getting-Backtraces-in-ROS-2.html#from-a-launch-file for an example.

Is that what you are asking about?

wkaisertexas commented 3 months ago

Yes, I was a bit confused because it was lumped in as kwargs. Should there be a note about prefixing in the documentation for this method?

clalancette commented 3 months ago

Yes, I was a bit confused because it was lumped in as kwargs. Should there be a note about prefixing in the documentation for this method?

Yep, that would be great! Feel free to open a PR doing that, we are happy to review it.

wkaisertexas commented 3 months ago

@clalancette I am not sure if this is the correct way to do this with sphinx and the documentation system