ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
13

How can I get my cout output on the console with roslaunch

asked 2011-03-17 21:29:16 -0500

Benoit Larochelle gravatar image

updated 2011-03-18 05:52:44 -0500

Why does only error output appear at the console when launching a ros node from roslaunch? Also, I can I force the normal behavior, so that I can see my cout output?

For example, I wrote this in a simple node:

ROS_INFO("ROS_INFO");
ROS_WARN("ROS_WARN");
ROS_ERROR("ROS_ERROR");
std::cout << "cout" << std::endl;
std::cerr << "cerr" << std::endl;

If I call rosrun myNode myNode, I see the five lines. If I call roslaunch myNodeLauncher, I see only ROS_ERROR and std::cerr.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
27

answered 2011-03-17 21:38:30 -0500

KoenBuys gravatar image

In your Roslaunch XML add the following within your node tags:

output="screen"

You can always change the debug-level from RXconsole, select the node and change the level (rxloggerlevel).

edit flag offensive delete link more
5

answered 2011-03-17 21:38:00 -0500

Ugo gravatar image

Hi,

I'm not sure if you can see the std::cout when using roslaunch. To see all log messages (the one you print using ROS_INFO / ... ), you can use rxconsole.

Do you know about ROS_ERROR_STREAM / ROS_WARN_STREAM / ROS_INFO_STREAM ? It allows you to use a cout kind of syntax:

ROS_ERROR_STREAM("This is my index: " << i);

Hope this helps.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-03-17 21:29:16 -0500

Seen: 40,219 times

Last updated: Mar 17 '11