ros-perception / openslam_gmapping

218 stars 206 forks source link

ROS logging instead of error stream #16

Closed hiddewie closed 1 year ago

hiddewie commented 7 years ago

From http://answers.ros.org/question/10294/how-to-suppress-the-annoying-gmapping-messages-related-to-laser-scans/, there was a request for a PR for writing debug messages to the ROS_DEBUG* macros instead of cerr. The messages are ennoying because they cannot be turned off by removing output="screen" from a ROS launch file. Also, ROS adds a timestamp, and makes the debug messages available over the network. Finally, by setting the logging level in ROS, only the required messages are received in the console.

Introduces a dependency on roscpp for building.

Only gridfastslam has been done at this time. Other packages can be done if required.

vrabaud commented 7 years ago

Thx, that is very useful. I believe, you should use the macros from console_bridge instead, but have the package.xml depend on rosconsole_bridge. As explained http://wiki.ros.org/console_bridge

hiddewie commented 7 years ago

You are right, using console_bridge is much cleaner.

However, I have some trouble with the use of streams. The ROS console logging defines the *_STREAM macros. The console_bridge defined no such thing, so the logging code must be re-written partially to accomodate for all the non-string logged values.