7.9 Navigating a Square using Odometry (使用里程计走正方形)

就像我们使用基于里程表的往返脚本一样,我们将使用 /odom和 /base_link(或 /base_footprint)坐标系之间的tf转换来监视机器人的位置和方向。 但是,这次我们将尝试通过设置四个路径点(每个角点一个)来将机器人移动到一个正方形。 在运行结束时,我们可以看到机器人与起始位置和方向的接近程度。 让我们从模拟开始,然后在真实的机器人上进行尝试。
As we did with the odometry-based out-and-back script, we will monitor the position and orientation of the robot using the tf transform between the /odom and /base_link (or /base_footprint ) frames. However, this time we will attempt to move the robot in a square by setting four waypoints, one at each corner. At the end of the run, we can see how close the robot gets back to the starting location and orientation. Let’s start with a simulation and then try it on a real robot.

7.9.1 Navigating a Square in the ArbotiX Simulator (在ArbotiX Simulator中走正方形)

如果您已经运行了模拟的TurtleBot或Pi机器人,请先使用Ctrl-C结束模拟,以便我们从头开始测量里程。 然后再次启动模拟的机器人,运行RViz,然后运行nav_square.py脚本,如下所示:
If you already have a simulated TurtleBot or Pi Robot running, first Ctrl-C out of the simulation so we can start the odometry readings from scratch. Then bring up the simulated robot again, run RViz , then run the nav_square.py script as follows:

roslaunch rbx1_bringup fake_turtlebot.launch
rosrun rviz rviz -d `rospack find rbx1_nav`/sim.rviz
rosrun rbx1_nav nav_square.py

一个经典的结果如下所示:
A typical result is shown below:

和以前一样,里程计箭头说明了机器人沿其路线的各个点的前进方向。 如您所见,正方形并非与网格线完全对齐,但这还不错。
As before, the odometry arrows illustrate the heading of the robot at various points along its route. As you can see, the square is not perfectly aligned with the grid lines, but it’s not bad.

7.9.2 Navigating a Square using a Real Robot (使用Real Robot走正方形)

如果您有机器人,请立即尝试使用nav_square脚本,以了解其在现实世界中的里程表中表现如何。 首先终止所有正在运行的模拟机器人,然后启动您的机器人的启动文件。 对于TurtleBot,您可以运行:
If you have a robot, try out the nav_square script now to see how well it does with real-world odometry. First terminate any running simulated robots, then launch the startup file(s) for your robot. For a TurtleBot you would run:

roslaunch rbx1_bringup turtlebot_minimal_create.launch

(或者,如果您已经创建了一个启动文件来存储校准参数,则可以使用自己的启动文件。)
(Or use your own launch file if you have created one to store your calibration parameters.)

确保您的机器人有足够的工作空间-至少在机器人前方1.5米处且两侧至少有1米距离。
Make sure your robot has plenty of room to work in—at least 1.5 meters ahead of it and on either side.

如果您使用的是TurtleBot,我们还需要运行odom_ekf.py脚本,以便能够在RViz中查看TurtleBot的组合里程计坐标系。 如果您不使用TurtleBot,则可以跳过此步骤。 启动文件应在TurtleBot的笔记本电脑上运行:
If you are using a TurtleBot, we also need to run the odom_ekf.py script to be able to see the TurtleBot’s combined odometry frame in RViz . You can skip this if you are not using a TurtleBot. The launch file should be run on the TurtleBot’s laptop:

roslaunch rbx1_bringup odom_ekf.launch

如果RViz仍在您的工作站上运行,请关闭它,并使用ekf配置文件将其恢复。 或者,只需取消选中Odometry显示并选中Odometry EKF显示。
If RViz is still running on your workstation, shut it down and bring it back up with the ekf configuration file. Alternatively, simply un-check the Odometry display and check the Odometry EKF display.

rosrun rviz rviz -d `rospack find rbx1_nav`/nav_ekf.rviz

最后,再次运行nav_square.py脚本:
Finally, run the nav_square.py script again:

rosrun rbx1_nav nav_square.py

下图显示了在地毯上使用我自己的TurtleBot时的结果:
The following image shows the results when using my own TurtleBot on a low-ply carpet:

如您所见,结果还不错。 在现实世界中,机器人最终离开了起点11厘米,并且偏离了原始方向约15度。 但是,当然,如果我们第二次运行脚本而没有重新定位机器人,则整个轨迹过程中起始方向错误将一直抛出。
As you can see, the result is not too bad. In the real world, the robot ended up 11 cm away from the starting point and about 15 degrees off the original orientation. But of course, if we were to run the script a second time without repositioning the robot, the error in the starting orientation would throw off the entire trajectory.

7.9.3 The nav_square.py Script (nav_square.py脚本)

nav_square.py脚本与我们刚刚看过的基于里程表的往返脚本几乎相同,因此我们将不在此处显示。 唯一的区别是,我们现在将机器人的运动分为4次,每次都走1米长的路程并旋转90度,来代替原来的分为两次,每次1米长的路径旋转180度。 您可以在下面的链接中查看代码,也可以在rbx1_nav / nodes目录中查看自己的副本。
The nav_square.py script is nearly identical to the odometry-based out-and-back script that we just looked at so we won’t display it here. The only difference is that we now send the robot along four 1 meter legs using 90 degree rotations instead of two 1 meter legs using 180 rotations. You can look at the code at the link below or by viewing your own copy in the rbx1_nav/nodes directory.

源链接:nav_square.py
Link to source: nav_square.py

7.9.4 The Trouble with Dead Reckoning (路径推算的麻烦)

仅依靠内部运动数据而不参考外部地标导航路线的过程称为路径推算。 任何在任何时间段内完全依赖路径推算的机器人最终都将完全迷失。 问题的根源在于,里程表中即使很小的误差也会随着时间而累积。 想象一下,例如,在机器人直线移动3米之前,即使他的估计值仅仅只有1度的误差。 在运行结束时,机器人的位置将累积超过5厘米的误差。 由于机器人不知道它与预期的目标相距5厘米,因此下一次运动的计算在开始之前就会被减去此数量。
The processing of navigating a course while relying only on internal motion data and without reference to external landmarks is referred to as dead reckoning. Any robot that relies entirely on dead reckoning for any length of time will eventually become completely lost. The root of the problem is that even small errors in odometry accumulate over time. Imagine for example an error of even 1 degree in the robot’s estimated heading just before it moves straight for 3 meters. At the end of the run, the robot will be have accumulated an error of over 5 cm in its position. Since the robot does not know that it is 5 cm away from its intended destination, the calculation of the next movement will be off by this amount before it even gets started.

幸运的是,很早以前,机器人专家就开始尝试各种方法,将地标或其他外部参考合并到机器人导航中,我们将在SLAM一章中使用ROS进行相同的操作。
Fortunately, roboticists long ago started working on various ways to incorporate landmarks or other external references into robot navigation and we will do the same with ROS in the chapter on SLAM.

【 rbx1翻译 第七章、控制移动基座】第九节、使用里程计走正方形相关推荐

  1. 【 rbx1翻译 第七章、控制移动基座】第二节、运动控制级别

    7.2 Levels of Motion Control(运动控制级别) 可以在多个级别上控制移动机器人,这些级别中的绝大多数,ROS已经提供了相应的方法. 这些级别代表不同程度的抽象,从对电动机的直 ...

  2. 【 rbx1翻译 第七章、控制移动基座】第三节、用ROS扭转

    7.3 Twisting and Turning with ROS (用ROS扭转) ROS使用"Twist"消息类型(请参见下面的详细信息)来发布要由基本控制器使用的运动命令. ...

  3. 【 rbx1翻译 第七章、控制移动基座】第八节、使用里程计进行往返运动

    7.8 Out and Back Using Odometry (使用里程计进行往返运动) 现在,我们了解了里程表信息是如何在ROS中表示的,我们可以更精确地在往返过程中移动机器人. 下一个脚本将监视 ...

  4. Vulkan编程指南翻译 第七章 图形管线 第2节 Renderpasses(未完成)

    7.2  renderpass Vulkan图形管线和计算管线的区别之一是,你使用图形管线来渲染出像素,组成图像以供处理或显示给用户.在复杂的图形应用程序中,图片经过很多遍构建,每一遍都生成场景的一部 ...

  5. 第六章—身份认证、第七章—控制访问

    第六章 身份认证 身份认证概述:证实主体的真实身份与其所声称的身份是否相符的过程,是用户对资源访问的第一道关卡,是访问控制和审计的前提. 身份认证 (1)认证系统组成:认证服务器.认证系统用户端软件. ...

  6. Gradle2.0用户指南翻译——第七章. Java 快速入门

    翻译项目请关注Github上的地址: https://github.com/msdx/gradledoc 本文翻译所在分支: https://github.com/msdx/gradledoc/tre ...

  7. Kotlin学习笔记 第二章 类与对象 第九节 泛型

    参考链接 Kotlin官方文档 https://kotlinlang.org/docs/home.html 中文网站 https://www.kotlincn.net/docs/reference/p ...

  8. 第七章 控制PL/SQL错误

    一.错误控制一览 在PL/SQL中,警告或错误被称为异常.异常可以是内部(运行时系统)定义的或是用户定义的.内部定义的案例包括除零操作和内存溢出等.一些常见的内部异常都有一个预定义的名字,如ZERO_ ...

  9. 《Real-Time Rendering 4th Edition》读书笔记--简单粗糙翻译 第七章 阴影 Shadows

    写在前面的话:因为英语不好,所以看得慢,所以还不如索性按自己的理解简单粗糙翻译一遍,就当是自己的读书笔记了.不对之处甚多,以后理解深刻了,英语好了再回来修改.相信花在本书上的时间和精力是值得的. -- ...

最新文章

  1. 使用hibernate与mysql时数据不能插入的原因及解决办法
  2. HTML学习笔记之基本介绍
  3. 中国顶级 AI 研究者数量仅为美国 1/5:美国智库最新全球 AI 实力报告
  4. shell编程系列15--文本处理三剑客之awk格式化输出printf
  5. git在项目中的实际运用
  6. Aurora HDR 2019中文版
  7. 赞,全网开发者都在学的 26 门 AI 课程!
  8. Linux下 -bash: php: command not found 命令找不到
  9. js 验证身份证号码
  10. lru算法c语言实现单链表,基于单链表实现LRU算法
  11. nodejs学习笔记-用http模块开启服务器端口
  12. SpringBoot项目如何进行打包部署
  13. 在PyCharm环境下使用Jupyter Notebook
  14. 多功能多接口带头像挂件制作微信小程序源码
  15. vue加载m3u8视频格式
  16. android 读取单反相机,手机怎么直接读取相机照片更方便?
  17. 中国互联网有哪些黑色产业链?
  18. java 16 规定_java并发编程(十六)happen-before规则
  19. 马上6等待服务器响应,解决网页响应慢,等待时间过长,waiting(TTFB)时间过长...
  20. Acess错误:文件共享锁定数溢出

热门文章

  1. 浏览器中的主页图标不见了
  2. C语言的字符串输入函数gets_s()
  3. K-means聚类算法代码
  4. TencentOS tiny危险气体探测仪产品级开发
  5. 低代码开发平台到底是何方圣神? 居然可以虏获世界500强等企业的芳心!
  6. 非root查看手机数据库和SharedPreferences的方法
  7. 广告业务系统 之 框架沉淀 —— “数据消费型服务框架”
  8. 大数据测试平台搭建记录(CDH集群)
  9. 深度学习和计算机视觉相关总结
  10. 如何搭建属于自己的一个网站网址-----亲测有效