How to rename node label used by launch file

asked 2023-05-03 02:29:57 -0500

Tobin gravatar image

I'm wondering if it's possible to customise the node label used by a launch file. I am familiar with modifying RCUTILS_CONSOLE_OUTPUT_FORMAT in my bashrc but would like to modify something that seems out of the scope of that.

Here is the output when running multisim.launch.py from the turtlesim package:

$ ros2 launch turtlesim multisim.launch.py
[INFO] [launch]: All log files can be found below ~/.ros/log/2023-05-03-17-17-19-961453-machine-1029347
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [turtlesim_node-1]: process started with pid [1029348]
[INFO] [turtlesim_node-2]: process started with pid [1029350]
[turtlesim_node-2] [INFO] [1683098240.096851185] [turtlesim2.turtlesim]: Starting turtlesim with node name /turtlesim2/turtlesim
[turtlesim_node-1] [INFO] [1683098240.096998336] [turtlesim1.turtlesim]: Starting turtlesim with node name /turtlesim1/turtlesim
[turtlesim_node-1] [INFO] [1683098240.102962041] [turtlesim1.turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]
[turtlesim_node-2] [INFO] [1683098240.103205603] [turtlesim2.turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]
[INFO] [turtlesim_node-1]: process has finished cleanly [pid 1029348]
[INFO] [turtlesim_node-2]: process has finished cleanly [pid 1029350]

I would like change the following line from this:

[turtlesim_node-2] [INFO] [1683098240.096851185] [turtlesim2.turtlesim]: Starting turtlesim ...

to something like this with mycustomname:

[mycustomname] [INFO] [1683098240.096851185] [turtlesim2.turtlesim]: Starting turtlesim ...

I can modify the other parts using the environment variable mentioned above but can't for the life of me figure this out. I've looked through the documentation and thought this label might be called the launch prefix but realised that is something else. Any hints/help would be greatly appreciated :)

edit retag flag offensive close merge delete