ROS学习手记 - 6 使用ROS中的工具:rqt_console & roslaunch & rosed


http://wiki.ros.org/ROS/Tutorials/UsingRqtconsoleRoslaunch

  1. 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:

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值