http://wiki.ros.org/ROS/Tutorials/UsingRqtconsoleRoslaunch
-
Using rqt_console and roslaunch
This tutorial introduces ROS using rqt_console and rqt_logger_level for debugging and roslaunch for starting many nodes at once. If you use ROS fuerte or ealier distros whererqt isn't fully available, please see this page withthis page that uses old rx based tools.
rqt console工具的打开:
Using rqt_console and rqt_logger_level
rqt_console attaches to ROS's logging framework to display output from nodes.rqt_logger_level allows us to change the verbosity level (DEBUG, WARN, INFO, and ERROR) of nodes as they run.
Now let's look at the turtlesim output in rqt_console and switch logger levels in rqt_logger_level as we use turtlesim. Before we start the turtlesim,in two new terminals start rqt_console andrqt_logger_level:
$ rosrun rqt_console rqt_console
$ rosrun rqt_logger_level rqt_logger_level这里面就可以看到正在运行的node的信息,message内容等 。
logger level工具可以查看报警信息,注意logger level是有层级的,Fatal has the highest priority andDebug has the lowest. By setting the logger level, you will get all messages of that priority level or higher。
Logging levels are prioritized in the following order:
Fatal Error Warn Info Debug
使用roslaunch工具
roslaunch工具是按照launch文件开始运行nodes的工具,
Usage:
$ roslaunch [package] [filename.launch]
$ roslaunch beginner_tutorials turtlemimic.launch关于launch file :
位置:在package根目录下,有 src, include, launch文件夹,package.xml文件, 在launch文件夹下,建立finename.launch文件。
文件的内容怎么写,见文后附。
这里有个问题是,roslaunch运行了这个文件以后,出来俩跟随的turtle。只能使用rostopic pub来驱动,为何不能用rosrun turtlesim turtle_teleop_key来驱动?
$ rostopic pub /turtlesim1/turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]'
$ rosrun turtlesim turtle_teleop_key
========================================
The Launch File
Now let's create a launch file called turtlemimic.launch and paste the following: