Ask Your Question
2

[ROS2] How do you set verbosity of a Composable Node?

asked 2021-01-25 19:52:16 -0500

M@t gravatar image

updated 2021-01-27 14:01:42 -0500

Using ROS2 Foxy, and I want to set the verbosity (log level) of a composable node in the launch file. The code below shows the options I've tried:

container = ComposableNodeContainer(
    name='ExampleContainer',
    namespace='',
    package='rclcpp_components',
    executable='component_container',
    composable_node_descriptions=[
        ComposableNode(
            package='package_name',
            plugin='namespace::node_class', 
            name='node_name',
            extra_arguments=[{'LOG_LEVEL': 'INFO'}]   # Option 1, compiles but doesn't work
        )
    ],
    output='screen',
    arguments=['--ros-args', '--log-level', 'INFO']   # Option 2, compiles and works but causes the error below if the verbosity is set to 'DEBUG'
)

So far I haven't found anything that works properly. Does anyone know the correct syntax?

Option 2 does seem to work for WARN, INFO, and ERROR, but causes this run-time error with DEBUG:

[ERROR] [component_container-1]: process has died [pid 4137, exit code -11, cmd '/opt/ros/foxy/lib/rclcpp_components/component_container --ros-args --log-level DEBUG --ros-args -r __node:=ExampleContainer -r __ns:=/'].
edit retag flag offensive close merge delete

Comments

M@t did you ever get this working for DEBUG?

msmcconnell gravatar image msmcconnell  ( 2021-11-24 08:35:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-01-27 02:58:41 -0500

ralwing gravatar image

updated 2021-02-19 07:24:43 -0500

Missing colon after output='screen'

output='screen', arguments=['--ros-args', '--log-level', 'INFO']

Created an issue for that: https://github.com/ros2/ros2/issues/1091

edit flag offensive delete link more

Comments

Good catch with my syntax! After fixing that typo, it seems that Option 2 works for everything except DEBUG.

M@t gravatar image M@t  ( 2021-01-27 13:58:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2021-01-25 19:52:16 -0500

Seen: 320 times

Last updated: Feb 19 '21