set log level in launch file
Is there a way to set the log level for a node in a launch file?
I would find this practical.
Cheers, Gaël
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
Is there a way to set the log level for a node in a launch file?
I would find this practical.
Cheers, Gaël
Self answer: http://wiki.ros.org/rosconsole#Config...
The feature is not launch-file specific and works by setting an environment variable to a configuration file.
Combining calling rosservice in launch file and setting log level with rosservice, the launch-file specific way would be the following
<node pkg="rosservice" type="rosservice" name="set_move_base_log_level" args="call --wait /move_base/set_logger_level 'ros.move_base' 'debug'" />
I wouldn't be surprised if there's a proper launch file specific way of doing this... if someone knows, please enlighten us!
Sometimes a rosnode cleanup
is required prior to the launch that contains this, otherwise the --wait
results in this (at least in noetic)
Traceback (most recent call last):
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 152, in wait_for_service
uri = contact_service(resolved_name)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 113, in contact_service
s.connect(addr)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
...
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/rostime.py", line 190, in get_rostime
raise rospy.exceptions.ROSInitException("time is not initialized. Have you called init_node()?")
rospy.exceptions.ROSInitException: time is not initialized. Have you called init_node()?
Well I just tried it in kinetik like this:
<group if="$(arg use_DEBUG_OUTPUT)" >
<node pkg="rosservice" type="rosservice" name="set_logger_level" args="call /tf_mapping_node/set_logger_level '{logger: 'rosout', level: 'ERROR'}'"/>
</group>
But it somehow failes for me....
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2014-11-21 09:24:25 -0500
Seen: 19,635 times
Last updated: Apr 04 '21
Setting ROS2 log level in XML launch file
Using .launch vs .launch.xml and yaml
Probleme with parameter queue_size in image_proc node
run server with launch file on ROS 2 [closed]
Turtlebot Launching while Anaconda is installed
Cannot control 2x UR10 at once with ur_robot_driver
Does <param> override an included launch file's variable?