Ask Your Question

How to suppress the annoying gmapping messages (related to laser scans)?

asked 2011-06-17 17:51:53 -0600

Whenever I launch gmapping (even without the option output="screen"), I still get the annoying messages, such as:

Registering Scans:Done

Laser Pose= 0.886656 -0.155651 2.77905

Registering Scans:Done

Laser Pose= 0.886656 -0.155651 2.77905

This is a bit annoying since it fills up the screen with that info. Does anyone know how to suppress these messages?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-06-17 23:51:32 -0600

dornhege gravatar image

They are direct printouts to stderr. You could redirect stderr, but the proper way would be to exchange the calls to ROS_INFO/ROS_DEBUG in the source.

edit flag offensive delete link more


I'd happily accept a patch that disables those prints or converts them to ROS_* macro calls (the latter would mean building `gmapping` itself against part of ROS, which is a little strange, but should work).
Brian Gerkey gravatar imageBrian Gerkey ( 2011-06-20 04:44:16 -0600 )edit
printouts to stderr? Does this mean that these scans are erroneous? Why would gmapping output to stderr unless there is a problem?
ubuntuslave gravatar imageubuntuslave ( 2011-06-21 08:40:31 -0600 )edit

One informal unix convention (violated by rosconsole, unfortunately) is that stderr is for all logging and diagnostic information, not just errors, while stdout is only for actual "output", e.g., stuff that might potentially be piped to another program.

bhaskara gravatar imagebhaskara ( 2012-05-08 10:39:51 -0600 )edit

answered 2012-05-08 10:27:42 -0600

To expand on what dornhege suggested:

Let's assume your launch file is called slam_gmapping.launch and it's in the slam_gmapping package. A quick way to suppress the messages is to launch it like this:

roslaunch slam_gmapping slam_gmapping.launch 2>/dev/null

I use that trick to launch any launch file which direclty or indirectly includes gmapping.

edit flag offensive delete link more


Hi, I am trying to redirect the stderr and so far, the only way that works is using your 2>/dev/null trick Now how could you do that in a .launch file? It doesnt seem to accept args in a launch include tag, and for nodes it doesnt seem to work. I could make a bash script for this, but thats ugly...

koenlek gravatar imagekoenlek ( 2014-05-07 00:05:02 -0600 )edit

I know this is old koenlek, but did you ever find a solution?

Sebastian gravatar imageSebastian ( 2015-08-18 01:18:09 -0600 )edit

You can make a bash script e.g. "" with just this line: roslaunch slam_gmapping slam_gmapping.launch 2>/dev/null Put it in a package, usually in a 'script' folder, and you can run in like any node (from cmd line using rosrun, or from launch file using a <node> block)

koenlek gravatar imagekoenlek ( 2015-10-25 10:15:18 -0600 )edit

Thanks for the info. I just downloaded the source and edited out all the error messages. That works too.

Sebastian gravatar imageSebastian ( 2015-10-25 16:56:37 -0600 )edit

@Sebastien I know this post is really old, but do you remember which files you needed to change? Thanks

ncharron gravatar imagencharron ( 2017-07-31 16:46:04 -0600 )edit

Just grep the error message,

Sebastian gravatar imageSebastian ( 2019-02-27 16:55:05 -0600 )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

1 follower


Asked: 2011-06-17 17:51:53 -0600

Seen: 1,528 times

Last updated: May 08 '12