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 <launch>
2
3 <group ns="turtlesim1">
4 <node pkg="turtlesim" name="sim" type="turtlesim_node"/>
5 </group>
6
7 <group ns="turtlesim2">
8 <node pkg="turtlesim" name="sim" type="turtlesim_node"/>
9 </group>
10
11 <node pkg="turtlesim" name="mimic" type="mimic">
12 <remap from="input" to="turtlesim1/turtle1"/>
13 <remap from="output" to="turtlesim2/turtle1"/>
14 </node>
15
16 </launch>

The Launch File Explained

Now, let's break the launch xml down.

Here we start the launch file with the launch tag, so that the file is identified as a launch file.

切换行号显示

3   <group ns="turtlesim1">
4 <node pkg="turtlesim" name="sim" type="turtlesim_node"/>
5 </group>
6
7 <group ns="turtlesim2">
8 <node pkg="turtlesim" name="sim" type="turtlesim_node"/>
9 </group>

Here we start two groups with a namespace tag of turtlesim1 and turtlesim2 with a turtlesim node with a name of sim. This allows us to start two simulators without having name conflicts.

切换行号显示

11   <node pkg="turtlesim" name="mimic" type="mimic">
12 <remap from="input" to="turtlesim1/turtle1"/>
13 <remap from="output" to="turtlesim2/turtle1"/>
14 </node>

Here we start the mimic node with the topics input and output renamed to turtlesim1 and turtlesim2. This renaming will cause turtlesim2 to mimic turtlesim1.

This closes the xml tag for the launch file.

2. Using rosed

rosed is part of the rosbash suite. It allows you to directly edit a file within a package by using the package name rather than having to type the entire path to the package.

Usage:

$ rosed [package_name] [filename]

Example:

$ rosed roscpp Logger.msg

This example demonstrates how you would edit the Logger.msg file within the roscpp package.

If this example doesn't work is probably because you don't have the
vim editor installed. Please refer to Editor section. If you don't know how to get out of vim, click here.

If the filename is not uniquely defined within the package, a menu will prompt you to choose which of the possible files you want to edit.

Using rosed with tab completion

This way you can easily see and optionally edit all files from a package without knowing its exact name.

Usage:

$ rosed [package_name] <tab><tab>

Example:

$ rosed roscpp <tab><tab>
  • Empty.srv                   package.xml
    GetLoggers.srv roscpp-msg-extras.cmake
    Logger.msg roscpp-msg-paths.cmake
    SetLoggerLevel.srv roscpp.cmake
    genmsg_cpp.py roscppConfig-version.cmake
    gensrv_cpp.py roscppConfig.cmake
    msg_gen.py

Editor

The default editor for rosed is vim. The more beginner-friendly editor
nano is included with the default Ubuntu install. You can use it by editing your ~/.bashrc file to include:

export EDITOR='nano -w'

To set the default editor to emacs you can edit your ~/.bashrc file to include:

export EDITOR='emacs -nw'

NOTE: changes in .bashrc will only take effect for new terminals. Terminals that are already open will not see the new environmental variable.

Open a new terminal and see if EDITOR is defined:

$ echo $EDITOR
  • nano -w

    or

    emacs -nw

Now that you have successfully configured and used rosed, let's create a Msg and Srv.

ROS学习手记 - 6 使用ROS中的工具:rqt_console & roslaunch & rosed的更多相关文章

  1. ROS学习手记 - 5 理解ROS中的基本概念_Services and Parameters

    上一节完成了对nodes, Topic的理解,再深入一步: Services and Parameters 我不理解为何 ROS wiki 要把service与parameter放在一起介绍, 很想分 ...

  2. ROS学习手记 - 8 编写ROS的Publisher and Subscriber

    上一节我们完成了 message & srv 文件的创建和加入编译,这次我们要玩简单的Publisher 和 Subscriber 要玩 Publisher 和 Subscriber, 需要具 ...

  3. ROS学习手记 - 7 创建ROS msg & srv

    至此,我们初步学习了ROS的基本工具,接下来一步步理解ROS的各个工作部件的创建和工作原理. 本文的详细文档:http://wenku.baidu.com/view/623f41b3376baf1ff ...

  4. ROS学习手记 - 2.1: Create and Build ROS Package 生成包(Python)

    ROS学习手记 - 2.1: Create and Build ROS Package 生成包(Python) 时隔1年,再回来总结这个问题,因为它是ros+python开发中,太常用的一个操作,需要 ...

  5. ROS学习(一)Ros 中使用kinect

    上的安装说明如下: 官网上明确写了如果安装windows kinect还需要安装一个驱动,但是有些ROS的书上并没有这么做,只提到了使用如下两步进行安装即可使用: sudo apt-get insta ...

  6. ROS学习笔记一(ROS的catkin工作空间)

    在安装完成ROS indigo之后,需要查看环境变量是否设置正确,并通过创建一个简单的实例来验证ROS能否正常运行. 1 查看环境变量 在ROS的安装过程中,我们执行了如下命令:(此命令就是向当前用户 ...

  7. ROS学习笔记九:ROS工具

    ROS有各种工具可以帮助用户使用ROS.应该指出,这些GUI工具是对输入型命令工具的补充.如果包括ROS用户个人发布的工具,那么ROS工具的数量很庞大.其中,本文讨论的工具是对于ROS编程非常有用的辅 ...

  8. ROS学习笔记一:ROS安装与测试

    1 Ubuntu和ROS版本的对应关系 Ubuntu 和 ROS 都存在不同的版本,其对应关系如下: 注:如果Ubuntu版本和ROS版本不对应的话,安装就不会成功了- 笔者安装的是Ubuntu14. ...

  9. ROS学习手记 9 -- 阶段性复习

    ROS 阶段性总结 1. 基本概念 ROS 是建立在Linux特别是Ubuntu系统上的一套软件系统,它具有操作系统的特征 ,负责管理各个模块的协同运行.设计初衷主要是面向机器人软硬件开发的特点:多 ...

随机推荐

  1. ubuntu base make 未找到命令

    引用:https://blog.csdn.net/fenglibing/article/details/7096556 1.先放入UBUNTU安装盘到光盘中: 2.再按顺序执行以下的命令: sudo ...

  2. 测试教程网.unittest教程.4. 实例: 读取测试数据并测试弱密码

    From: http://www.testclass.net/pyunit/test_example_2/ 背景 接上一节的弱密码例子,我们的用例尽管运行的不错,但还是有点问题. 假如我们需要增加一些 ...

  3. Mina - 模拟同步请求

    这篇博客主要就铺代码吧,Mina的一些基础知识可以参考: http://www.cnblogs.com/huangfox/p/3458272.html 场景假设: 1.客户端发送用户信息,服务端根据用 ...

  4. virtualBox NAT模式,设置虚拟机可上网,宿主机可访问虚拟机的方法

    环境描述: 宿主机:windows Server 2008 64bit,IPV4地址,有网络. 宿主机上的主要软件环境: virtualBox 5.0.24 virtualBox中安装了CentOS ...

  5. 如果遇到Hadoop集群正常,MapReduce作业运行出现错误,如何来查看作业运行日志(图文详解)

    不多说,直接上干货! 这个时候我们可以进入logs下的userlogs 备注:userlogs目录下有很多个以往运行的作业,我选择最新的最大编号的作业,就是我们当前运行作业的日志.然后找到stderr ...

  6. mac brew 安装 nginx fpm mysql 教程

    一. 安装brew 要求:OS X 10.6以上系统,并且安装有XCode命令行工具 对于10.11的系统需要设置下local的权限为当前用户 $ sudo chown -R $(whoami):ad ...

  7. spring4.0之九:websocket简单应用

    Spring 4.0的一个最大更新是增加了websocket的支持.websocket提供了一个在web应用中的高效.双向的通讯,需要考虑到客户端(浏览器)和服务器之间的高频和低延时消息交换.一般的应 ...

  8. Java NIO系列教程(二) Channel通道介绍及FileChannel详解

    目录: <Java NIO系列教程(二) Channel> <Java NIO系列教程(三) Channel之Socket通道> Channel是一个通道,可以通过它读取和写入 ...

  9. web前端开发浅析

    原文地址:http://www.cnblogs.com/babyzone2004/articles/1807381.html 摘 要:前端开发作为一项新的领域,经历的时间随然较短,却显示了强大的生命里 ...

  10. String MVC @RequestParam(required=false) int XXX 参数为空报错解决方法

    今天在用@RequestParam(required=false) int XXX 取参数的时候,当参数没有的时候Spring默认赋值为空.而此时使用基本类型int,所以报错,建议使用包装类 Inte ...