How to disable the output of one node
Hey everybody,
I'm using the usbcam-package and this is sending a lot of error/info massages I don't want to see. The massages are not produced with ROSERROR but come from some included package (probably std::cout). The video stream is working regardless the error and I don't have the time to resolve the issue. I tried "Setting Verbosity Levels" from http://wiki.ros.org/roscpp/Overview/Logging but it didn't work.
My question therefor is if it is possible to "mute" this node so that the node-output is not flooding my console? I still want to see the output of the other nodes.
Thank you
Robert
Asked by RobertZickler on 2020-10-16 10:09:49 UTC
Answers
Have you tried including output="log"
inside the corresponding
For instance
<launch>
<node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="log"/>
</launch>
From the documentation at http://wiki.ros.org/roslaunch/XML/node:
output="log|screen"(optional)
If 'screen', stdout/stderr from the node will be sent to the screen. If 'log', the stdout/stderr output will be sent to a log file in $ROS_HOME/log, and stderr will continue to be sent to screen. The default is 'log'.
Asked by Roberto Z. on 2020-10-16 10:57:56 UTC
Comments
Hey Roberto,
thank you. I've seen and tried that but I still get the error messages. How can I silent those too? "stderr will continue to be sent to screen"
Asked by RobertZickler on 2020-11-02 05:28:08 UTC
More than two years later, I came into the same issue with the usb_cam
package. Below I propose two solutions, a general one, and a package-specific one.
General solution to mute rosrun
output
A possible solution when launching a node from the command line, is to redirect the output (find a brief introduction to the topic and a useful cheat-sheet here) of the node by using
rosrun package_name node_name 2>&-
With this, one can run the node and see the [INFO]
messages, while muting the unwanted warnings/errors.
Avoid usb_cam_node
errors passing the right params at launch
Inspecting the usb_cam-test.launch
file, I have noticed the following parameters being passed to the usb_cam_node
at launch:
<node pkg="usb_cam" name="usb_cam_node" type="usb_cam_node">
<param name="video_device" value="/dev/video0" />
<param name="image_width" value="640" />
<param name="image_height" value="480" />
<param name="pixel_format" value="yuyv" />
<param name="color_format" value="yuv422p" />
<param name="camera_frame_id" value="usb_cam" />
<param name="io_method" value="mmap"/>
</node>
In my case, this set of params solved the warning messages.
Any explanation of the meaning of the parameters (and possibly of those to be held accountable for the warnings) is very welcome! I will do my best to update the answer with more insights if I have the occasion to dig a little bit more into this topic.
Asked by bluegiraffe-sc on 2023-02-27 16:40:15 UTC
Comments
Some years later, experiencing the very same issue with
usb_cam
. Did you managed to find a solution?Asked by bluegiraffe-sc on 2023-02-27 12:47:14 UTC
As I can remember I didn't. Sorry.
Asked by RobertZickler on 2023-02-27 14:25:24 UTC