How to make the ROS_INFO output stable? There is no other printout anywhere but this.

asked 2018-04-18 01:48:45 -0500

cklip gravatar image

updated 2018-04-18 10:07:40 -0500

Minimum distance 4.191115

                                         Minimum distance 4.190969

                                                                   Minimum distance 4.188169

  Minimum distance 4.190690

      Minimum distance 4.190304

                                Minimum distance 4.190628

                                                          Minimum distance 4.189540

Console output when the output formatting breaks

process[twist_mux-11]: started with pid [8118]
process[spawn_husky_model-12]: started with pid [8142]
[ INFO] [1524064476.680043681]: [twist_marker_server] Initialized.
[WARN] [1524064476.925794, 0.000000]: DEPRECATION warning: --shutdown-timeout has no effect.
[ INFO] [1524064476.985947174]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1524064476.988022291]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
libGL error: failed to create drawable
                                      [ INFO] [1524064478.110975520, 0.022000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
                                                                                                                                                             [ INFO] [1524064478.189070053, 0.072000000]: Physics dynamic reconfigure ready.
                                Warning [] multiple inconsistent <gravity> exists due to fixed joint reduction overwriting previous value [true] with [false].
                                                                                                                                                                                 [ INFO] [1524064479.110225758, 0.282000000]: Laser Plugin: Using the 'robotNamespace' param: '/'

The code snippet

void HuskyHighlevelController::subscriberCallback(const sensor_msgs::LaserScan::ConstPtr &msg){
    min_dist = msg->ranges[0];
    for (int i = 0; i < msg->ranges.size(); i++){
        float r = msg->ranges[i];
        if (r<min_dist){
            min_dist = r;
    ROS_INFO_STREAM("Minimum distance :" << min_dist);
edit retag flag offensive close merge delete



ROS_INFO (and the other logging macros) are working quite ok for me and a lot of other users. I suspect something is not right in your code that calls the macro/function.

If you could show how you use LOG_INFO(..), perhaps we can determine what is going on.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-18 02:43:19 -0500 )edit


I am running this code -

My own version of this code also produces the same print out

Perhaps some environment variable of bash?

cklip gravatar image cklip  ( 2018-04-18 02:51:19 -0500 )edit

It is the same behavior in this tutorial video also

cklip gravatar image cklip  ( 2018-04-18 02:56:52 -0500 )edit

Please add a snippet/extract of the exact code to your question.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-18 02:58:12 -0500 )edit

Added the code snippet to the question.

cklip gravatar image cklip  ( 2018-04-18 03:21:06 -0500 )edit