[ros-users] beginner logging question

Michael Styer michael at styer.net
Sat Jul 10 01:02:42 UTC 2010


OK, fwiw I've found a partial solution to the problem. I wrote a little
test app (pasted below). On my workstation I set
ROS_MASTER_URI=http://robot:11311 and run rxconsole. Then, if I run my
test app in a terminal on my workstation, I get output at the terminal
but not in rxconsole. If I SSH to the robot and run my test app there, I
get output both on the terminal and on rxconsole. The same is true of
the real node I'm writing.

Is that expected? I.e., should I expect rosconsole messages from a node
running on machine A to be reported by machine B? It seems like I
should, but that's not what's happening. Could there be something not
configured correctly in our setup?

Thanks for your help!

Mike

PS: here's my test app. I just run it with 'rosrun <package> log_test'.

#include <ros/ros.h>

int main(int argc, char** argv)
{
  if (argc<2) {
    printf("Usage: %s <log_level>\n", argv[0]);
    return 0;
  }
  ros::init(argc, argv, "log_test");

  ros::NodeHandle nh;
  ros::Rate loop_rate(1);
  while (nh.ok()) {
    switch (atoi(argv[1])) {
        case 1: 
            ROS_DEBUG("Beep");
            break;
        case 2:
            ROS_INFO("Beep");
            break;
        case 3:
            ROS_WARN("Beep");
            break;
        case 4:
            ROS_ERROR("Beep");
            break;
    }
    loop_rate.sleep();
  }
}

On Fri, 2010-07-09 at 16:59 -0700, Michael Styer wrote:
> Thanks for the suggestion, Jan. I just tried that now, and noticed the
> 'output' parameter to the node tag. If I set it to 'screen', I get my
> debug messages on the terminal; if I set it to 'log', they don't appear
> on the terminal, but they don't appear in rxconsole either. 
> 
> I also just noticed that no messages from my node get sent to rxconsole,
> regardless of level. Changing ROS_DEBUG to ROS_WARN still doesn't make
> them appear. So it doesn't seem to be a problem with the logging level.
> I'll keep digging into it, but thanks for your help.
> 
> Mike
> 
> On Sat, 2010-07-10 at 01:29 +0200, "Jan Tünnermann" wrote:
> > Hello Mike,
> > 
> > I'm quite a beginner myself, so I'm not sure if I can help.
> > I noticed that starting nodes by directly executing the binary would lead
> > to ROS_INFO output to stdout. Starting via a .launch-file and roslaunch
> > leads to output in the rxconsole. I'm not sure if that could be the issue
> > in your case...
> > 
> > jan
> > 
> > 
> > Am Sa, 10.07.2010, 01:10 schrieb Michael Styer:
> > > Hello,
> > >
> > > I have an elementary question about logging in roscpp.
> > >
> > > In my node, I have a bunch of ROS_DEBUG("hello world") statements that
> > > I'd like to see in rxconsole. At first, when I ran the node, I didn't
> > > see those statements anywhere. Reading through the documentation I
> > > figured out that I can change the default logging level for my package
> > > by creating a local rosconsole.config file; I did that, and now I see my
> > > debugging statements printed to stdout in the terminal where I started
> > > the node.
> > >
> > > But I still don't see any of those statements in rxconsole (there are
> > > lots of other things printed to rxconsole, though). I have all the
> > > "Severity" boxes checked, I don't have the "Enabled" box checked, and
> > > when I bring up rxloggerlevel, the level for my package is "Debug".
> > >
> > > What am I missing?
> > >
> > > Thanks!
> > >
> > > Mike
> > >
> > >
> > > _______________________________________________
> > > ros-users mailing list
> > > ros-users at code.ros.org
> > > https://code.ros.org/mailman/listinfo/ros-users
> > >
> > >
> > 
> > _______________________________________________
> > ros-users mailing list
> > ros-users at code.ros.org
> > https://code.ros.org/mailman/listinfo/ros-users
> 
> 
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users





More information about the ros-users mailing list