ROS进阶学习手记 7 -- RViz仿真实例1

2023-05-16


【任务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仿真机器人,启动成功后显示信息如下:

view robot

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

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

view control


    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
         找了半天估计是跟错教程了,果断换






本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

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

随机推荐

  • 关于STL和Boost的理解

    xff11 xff0e STL STL是standard Template Library即标准模板库的英文缩写 xff0c 是惠普实验室开发的一系列软件的统称 从根本上讲 STL是一些 容器 的集合 xff0c 这些容器有list vec
  • Ubuntu 各版本号和名称对照

    版本开发代号中译发布日期支持结束时间内核版本桌面版服务器版4 10Warty Warthog多疣的疣猪2004 10 202006 04 302 6 85 04Hoary Hedgehog白发的刺猬2005 04 082006 10 312
  • 【无标题】安装ROS E: 无法定位软件包 ros-melodic-desktop-full

    一 遇到问题 二 可能的原因和解决方法 1 源换一下 xff1a xff08 1 xff09 我是看这位大佬的 5条消息 记录 解决Ubuntu安装ros报错E Unable to locate package ros kinetic de
  • 无线通信原理及协议栈(ZigBee、蓝牙等)解析

    1 天线 说起无线电通信 xff0c 不可不提起天线 在无线电设备中 xff0c 用来辐射和接收无线电波的装置称为天线 在发射端 xff0c 发射机产生的已调制的高频振荡电流 xff08 能量 xff09 经馈电 xff08 指被控制装置向
  • 串口Serial连接方式

    串口Serial连接方式 1 协议终端选择Serial 2 会话选项 xff0c 选择 串行 3 进入电脑 设备管理器 xff0c 查看USB Serial Port以及端口设置 串行选项根据端口设置配置 确定并连接即可
  • tcp/ip 协议栈实现2-socket文件系统

    core initcall sock init net socket c static int init sock init void int err Initialize sock SLAB cache sk init Initializ
  • VMware虚拟机安装Windows11(无需设置TPM密码)

    VMware虚拟机安装Windows11 xff08 无需设置TPM密码 xff09 注意 xff1a 需要新版VMware xff0c 目前小白的版本为 16 2 3 一 新建虚拟机向导 1 新建虚拟机 点击菜单栏文件 新建虚拟机 2 配
  • ROS相关:使用rospy 编写ros程序并使用rosbag存储数据

    为什么使用rospy ROS支持C 43 43 和Python xff0c 由于ROS的底层是由C 43 43 编写 xff0c 因此大多数的ROS程序都使用C 43 43 xff0c 但是Python语言接口简单 xff0c 更容易编写
  • C函数调用过程

    这几天在看GCC Inline Assembly xff0c 在C代码中通过asm或 asm 嵌入一些汇编代码 xff0c 如进行系统调用 xff0c 使用寄存器以提高性能能 xff0c 需要对函数调用过程中的堆栈帧 xff08 Stack
  • 【GitHub】Branches和Tags分别是做什么用的?

    在 GitHub 中 xff0c Branches xff08 分支 xff09 和 Tags xff08 标签 xff09 都是用于版本控制的重要工具 Branches xff08 分支 xff09 可以用来创建一个新的开发分支 xff0
  • git clone 指定分支

    我们在有一个工程的权限后 xff0c 按照常规操作去拉代码 xff0c 往往会拉到默认的master分支 若我们担心master分支拉下来后 xff0c 与其他代码有冲突 xff0c 想直接拉某分支的代码 xff0c 则该怎么操作呢 1 我
  • rocketmq的消息msgId和offsetMsgId

    1 rocketmq的消息发送时 xff0c producer客户端 生成msgId xff08 通过 ip 43 进程 43 自增值 43 当前与系统启动时间差值 xff09 xff0c 有另外的一个叫法uniqId 方法入口 xff1a
  • 算法 - 桶排序(Bucket Sort)

    执行流程 xff1a 创建一定数量的桶 xff08 比如用数组 链表作为桶 xff09 按照一定的规制 xff08 不同类型的数据 xff0c 规则不同 xff09 xff0c 将序列中的元素均匀分配到对应的桶分别对每个桶进行单独排序将所有
  • 测试Pangolin是否安装成功

    一 终端输入 cd Pangolin examples HelloPangolin cmake make HelloPangolin 二 显示这个结果则成功 三 顺便放一个 我可终于装完了ORB SLAM3 被内存不够折腾了好久 换个内存条
  • 交叉编译工具 aarch64-linux-gnu-gcc 的介绍与安装

    AArch64 是随 ARMv8 ISA 一起引入的 64 位架构 xff0c 用于执行 A64 指令的计算机 而且在 AArch64 状态下执行的代码只能使用 A64 指令集 xff0c 而不能执行 A32 或 T32 指令 但是 xff
  • 02 机器学习中的评估指标

    机器学习中的评估指标 1 机器学习的目标 根本目标 xff1a 在给定的训练数据上 xff0c 试图训练出能够归纳数据的规律的模型 xff0c 并且能在未知样本上也有好的效果 泛化能力强的模型最好 能很好地适用于未知样本 xff0c 如错误
  • 方便Git提交代码的几个工具

    团队使用git管理代码 xff0c 为了提交方便 xff0c 查看Log方便 xff0c 师傅告诉我先安装几个工具 xff0c 如下 xff1a cola gitk AnyEdit 一 gitk安装 xff08 备注 xff1a 开始我没走
  • git提交 本地分支和远程分支断开连接

    1级标题 当 git push origin branch name时遇到报错如下 xff1a fatal origin does not appear to be a git repository fatal Could not read
  • spring MVC中关于model.addAttribute的使用方法【翻译】

    关于model addAttribute的使用方法 http krams915 blogspot com 2010 12 spring 3 mvc using modelattribute in html 可能要 break the wal
  • ROS进阶学习手记 7 -- RViz仿真实例1

    任务2 xff1a 用simulator RViz 工具 xff0c 完成对小车的建模 xff0c 名字drive RViz 61 dvrv 用 dvrv node 发布topic和数据格式 xff0c 向它发送位置指令 xff0c 使它能