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 | ros @ Robotics Stack Exchange |
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....
Asked: 2014-11-21 09:24:25 -0500
Seen: 21,620 times
Last updated: Apr 04 '21
How do I set the logging directory in Foxy?
[ROS2 eloquent] import funtion from other python file in launch
Set parameters in ROS2 using a yaml file without needing to build the package every time
Can we include launch file descriptions that are written in some other langauge?
How to prevent launch shutdown on single remote connection failure? (required="true" not working)
define a path in a launch file programatically