Ask Your Question
3

Why roslaunch couldn't show the ROS_INFO message?

asked 2011-09-23 21:59:43 -0500

sam gravatar image

node_test.cpp

 #include "ros/ros.h"

 int main(int argc, char **argv)
 {
    //ROS的初始化
    ros::init(argc, argv, "basic_node");
    ROS_INFO("%s","Hello World!!");
    //讓ROS進入無窮迴圈,但能進行事件處理
    ros::spin();
    return 0;
 }

basic.launch

 <launch>
    <node pkg="basic_node" name="basic" type="basicNode"/>
 </launch>

Just run is ok:

 sam@/home/sam/code/ros/node/basic_node$ ./bin/basicNode 
 [ INFO] [1316858268.471014429]: Hello World!!

Why I run with roslaunch is not ok?

 sam@/home/sam/code/ros/node/basic_node$ roslaunch basic_node      basic.launch 
 ... logging to      /home/sam/.ros/log/afeaec82-e691-11e0-9f34-20cf30a2382f/roslaunch-sam-Syst     em-Product-Name-11412.log
 Checking log directory for disk usage. This may take awhile.
 Press Ctrl-C to interrupt
 Done checking log file disk usage. Usage is <1GB.

 started roslaunch server http://sam-System-Product-Name:41031/

 SUMMARY
 ========

 PARAMETERS
  * /rosversion
  * /rosdistro

 NODES
   /
     basic (basic_node/basicNode)

 ROS_MASTER_URI=http://localhost:11311

 core service [/rosout] found
 process[basic-1]: started with pid [11430]

How to show message on roslaunch?

Thank you~

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
18

answered 2011-09-24 00:51:20 -0500

Pi Robot gravatar image

Hi Sam,

Just add output="screen" to your node line in the launch file, like this:

<launch>
   <node pkg="basic_node" name="basic" type="basicNode" output="screen" />
</launch>

--patrick

edit flag offensive delete link more

Comments

It's help for me thanks!!!!

Liuche gravatar imageLiuche ( 2017-11-01 21:54:47 -0500 )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

Stats

Asked: 2011-09-23 21:59:43 -0500

Seen: 8,870 times

Last updated: Sep 24 '11