【任务2】:

    用simulator: RViz 工具,完成对小车的建模,名字drive RViz = dvrv, 用 dvrv_node 发布topic和数据格式,向它发送位置指令,使它能接受键盘输入,并完成前进,后退,转弯90°功能。

Topic, 还是拟用/turtle1/cmd_vel

Message Type: geometry_msgs/Twist

-----------

1. RViz介绍

参考:RViz Package Link: http://wiki.ros.org/rviz

                   内含:RViz User Guide:    http://wiki.ros.org/rviz/UserGuide

                              RViz Tutorials:        http://wiki.ros.org/rviz/Tutorials

rviz是一个显示机器人实体的工具,本身不具有模拟的功能,需要安装一个模拟器arbotix。但官网有关arbotix的资料很缺,跟另一个“10分钟上手玩ROS仿真”http://blog.exbot.net/archives/899, 对比一个不work的教程:ros_by_example_1_hydro.pdf 
(6.2 Testing the Simulator),有兴趣可以研究5. Installing the ros-by-example Code以后,再玩6.2, 估计就work了。本次就不深入那个。

2. 用ExBot机器人实验室的包来仿真

打开terminal,输入命令:

      roslaunch exbotxi_rviz view_model.launch

将会打开rviz,并加载查看ExBot XI移动机器人平台模型的配置。

ExBot XI移动机器人平台兼容turtlebot了,这里就用turtlebot包的键盘控制node来控制机器人移动。

Ctrl + C 结束掉前面的程序,关闭terminal,然后再打开3个terminal,分别输入下面的3个命令:

         roslaunch exbotxi_bringup fake_exbotxi.launch
roslaunch exbotxi_rviz view_mobile.launch
         roslaunch turtlebot_teleop keyboard_teleop.launch

跟这个“10分钟上手玩ROS仿真” 走完整个流程就好。

第1条命令用于启动ExBot XI仿真机器人,启动成功后显示信息如下:

第2条命令用于打开ROS可视化工具rviz,并加载移动机器人视图配置。

       第3条命令用于启动键盘控制node。

现在将光标focus在第3条命令的terminal窗口,便可以通过键盘控制仿真机器人了:

3. 拆解ExBot机器人实验室的包

首先打开fake_exbotxi.launch文件。(  ~/catkin_ws/src/exbot_xi/exbotxi_bringup/launch  )

  文件可以大概分为四个部分:

          (1) 从指定的包中加载urdf文件

          (2) 启动arbotix模拟器

          (3) 启动状态发布节点

          (4) tf 坐标系配置--本次可能没有

<launch>
<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find exbotxi_description)/urdf/exbotxi.urdf.xacro'" />
<param name="robot_description" command="$(arg urdf_file)" /> <node name="arbotix" pkg="arbotix_python" type="arbotix_driver" output="screen">
<rosparam command="delete" param="/arbotix" />
<rosparam file="$(find exbotxi_bringup)/config/fake_irobot_create_arbotix.yaml" command="load" />
<param name="sim" value="true"/>
<remap from="cmd_vel" to="mobile_base/commands/velocity"/>
</node> <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">
<param name="publish_frequency" type="double" value="8.0" />
</node> <node pkg="topic_tools" type="mux" name="exbotxi_mux1" args="mobile_base/commands/velocity cmd_vel_mux/input/teleop" />
<node pkg="topic_tools" type="mux" name="exbotxi_mux2" args="mobile_base/commands/velocity cmd_vel" />
</launch>

接下来的几个教程都要follow这个古月居的博客了,古月居的专栏:http://blog.csdn.net/column/details/ros-explore.html

附录:安装arbotix

安装 arbotix :  (如果联网有问题,还原网络设定,hosts文件有关的设定,http://blog.csdn.net/sonictl/article/details/46986565)

         $ sudo apt-get install ros-hydro-arbotix

然后加入ros package路径:

         $ rospack profile

参考:http://blog.csdn.net/scliu12345/article/details/44521327

         测试仿真器:

         $ roslaunch rbx1_bringup fake_turtlebot.launch

遇到错误,[fake_turtlebot.launch] is neither a launch file in package [rbx1_bringup] nor is [rbx1_bringup] a launch file name,

         找了半天估计是跟错教程了,果断换

ROS进阶学习手记 7 -- RViz仿真实例1的更多相关文章

  1. ROS进阶学习手记 7.2 -- RViz仿真实例2:Create SmartCar

    上一节玩了 exbot 在RViz里的仿真控制,这里我们用urdf文件写个自己的小车模型,ref: http://blog.csdn.net/hcx25909/article/details/8904 ...

  2. ROS进阶学习笔记(11)- Turtlebot Navigation and SLAM - ROSMapModify - ROS地图修改

    ROS进阶学习笔记(11)- Turtlebot Navigation and SLAM - 2 - MapModify地图修改 We can use gmapping model to genera ...

  3. ROS进阶学习笔记(11)- Turtlebot Navigation and SLAM

    (写在前面: 这里参考rbx书中第八章和ROS社区教程进行学习,先看社区教程) ===  Doing the Turtlebot Navigation   === ref ros wiki: http ...

  4. ROS 进阶学习笔记(13) - Combine Subscriber and Publisher in Python, ROS

    Combine Subscriber and Publisher in Python, ROS This article will describe an example of Combining S ...

  5. ROS进阶学习笔记(10)- 搭建自己的Turtlebot(5) - Interactive Makers

    用interactive_makers控制Turtlebot移动 interactive_makers 是Willow Garage公司开发的一个虚拟控制工具,可通过鼠标在虚拟环境中的操作,完成实际机 ...

  6. ROS 进阶学习笔记(12) - Communication with ROS through USART Serial Port

    Communication with ROS through USART Serial Port We always need to communicate with ROS through seri ...

  7. JMeter学习-011-JMeter 后置处理器实例之 - 正则表达式提取器(三)多参数获取进阶引用篇

    前两篇文章分表讲述了 后置处理器 - 正则表达式提取器概述及简单实例.多参数获取,相应博文敬请参阅 简单实例.多参数获取. 此文主要讲述如何引用正则表达式提取器获取的数据信息.其实,正则表达式提取器获 ...

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

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

  9. Python进阶学习之特殊方法实例详析

    Python进阶学习之特殊方法实例详析 最近在学习python,学习到了一个之前没接触过的--特殊方法. 什么是特殊方法?当我们在设计一个类的时候,python中有一个用于初始化的方法$__init_ ...

随机推荐

  1. 【java】JDK与JRE的区别

    JRE和JDK区别: JDK和JRE提供的服务包: JDK是整个JAVA的核心,JDK包含如下核心组件: ·javac – 编译器 ·jar – 打包工具 ·javadoc – 文档生成器 ·jdb ...

  2. camera-arm-RPI

    这个属于先收藏着,知道有个开源的东西. luvcview是一个开源项目,专注于UVC摄像头的测试,只要您的摄像头支持UVC驱动,即可使用luvcview测试程序,如何知道自己的摄像头是不是支持UVC驱 ...

  3. 黄聪:Pjax 无刷新开发web,更好用户体验

    什么Ajax.Pjax.Njax...神马玩意? 有Njax吗? 木有...不过真有Pjax!! 其实pjax就是用到了html5的新history api: pushState和replaceSta ...

  4. webstorm 破解码

    https://blog.csdn.net/voke_/article/details/76418116 摘自此博客

  5. 编译安装MySQL-5.7.13

    编译安装MySQL-5.7 cmake的重要特性之一是其独立于源码(out-of-source)的编译功能,即编译工作可以在另一个指定的目录中而非源码目录中进行,这可以保证源码目录不受任何一次编译的影 ...

  6. C++11--编译器生成的函数

    using namespace std; class Dog {}; /* C++ 03 * 1 默认构造函数(只有当用户没有声明任何构造函数) * 2 拷贝构造(只有当用户没有声明5,6),扩展到C ...

  7. go get golang.org/x 包失败解决方法

    由于墙的原因,国内使用 go get安装golang 官方包可能会失败 解决方法 方法1 [不需要FQ] Win10下相关配置: GOPATH : E:\go 安装记录: E:\>go get ...

  8. CSS3 圆角(border-radius)

    值:半径的长度 前缀 -moz(例如 -moz-border-radius)用于Firefox -webkit(例如:-webkit-border-radius)用于Safari和Chrome. 例1 ...

  9. 学习笔记之Everything

    Everything (software) - Wikipedia https://en.wikipedia.org/wiki/Everything_(software) Everything is ...

  10. 学习笔记之HTML 教程 | 菜鸟教程

    HTML 教程 | 菜鸟教程 http://www.runoob.com/html/html-tutorial.html 菜鸟教程在线编辑器 http://www.runoob.com/try/try ...