turtlebot3-burger_150.png
turtlebot3-waffle-pi_150.png
turtlebot3-arm_150.png
walking-y2_150.png
turbot3-multi_150.png
turbot3-dl-ros1_150.png
turbot3-ai.png
turbot3-dl-ros2_150.png
turbot3-slam_150.png
turbot3-arm_150.png
turtlebot4-lite_150.png
turtlebot4-pro_150.png
turbot4-dl_150.png
turbot4-ai_150.png
aidriving-racebot_150.png
aidriving-autodrive_150.png
turtlebot-arm_150.png
openmanipulator-x_150.png
Home » Turtlebot3自动驾驶2020仿真教程_视频版 » Turtlebot3自动驾驶2020仿真教程-车道识别

Turtlebot3自动驾驶2020仿真教程-车道识别

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号

Turtlebot3自动驾驶2020仿真教程-车道识别

说明:

  • 本教程主要介绍如何在TB3自动驾驶2020的仿真中实现车道识别的校准和测试流程
  • 由于在该仿真环境是固定不变的,所以可以先使用程序默认配置好的参数进行测试,若效果不好再重新校准

校准

  • 新终端,启动gazebo节点
$ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch
  • 新终端,启动相机的内标定
$ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch
  • 新终端,启动相机外标定
$ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch
  • 新终端,启动车道检测校准节点
$ roslaunch turtlebot3_autorace_detect detect_lane.launch mode:=calibration
  • 新终端,打开可视化界面
$ rqt
  • 点击rqt左上角菜单栏Plugins -> Cisualization -> Image view,依次添加三个窗口且分别订阅/detect/image_lane/compressed/detect/image_yellow_lane_marker/compressed/detect/image_white_lane_marker/compressed三个主题

请输入图片描述

请输入图片描述

请输入图片描述

  • 新终端,打开rqt_reconfigure工具
$ rosrun rqt_reconfigure rqt_reconfigure
  • 点击detect_lane后调整参数来过滤黄色和白色,实际需要的过滤效果可以参考上面两图

  • 首先应校准色相高低值:hue_white_lhue_white_h

  • 然后校准饱和度高低值:lightness_white_lsaturation_white_h

  • 最后是校准亮度高低值:lightness_white_lsaturation_white_h,由于源代码包含有亮度自动调节,所以只需将亮度的高值设置为255

  • 黄色车道的过滤流程也跟上面一样

请输入图片描述

  • 新终端,启动键盘控制节点
$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
  • 当你认为当前参数已经能稳定过滤出车道时,可以使用键盘控制TB3沿着车道中心走一段距离,观察话题/detect/image_lane/compressed的窗口里是否能正常过滤出车道

  • 新终端,将调整好的值写入turtlebot3_autorace_detect/param/lane/lane.yaml文件中

$ rosed turtlebot3_autorace_detect lane.yaml 
---
detect:
  lane:
    white:
      hue_l: 0
      hue_h: 179
      saturation_l: 0
      saturation_h: 70
      lightness_l: 105
      lightness_h: 255
    yellow:
      hue_l: 10
      hue_h: 127
      saturation_l: 70
      saturation_h: 255
      lightness_l: 95
      lightness_h: 255

测试

  • 关闭前面打开的所有终端

  • 新终端,启动gazebo节点

$ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch
  • 新终端,启动相机的内标定
$ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch
  • 新终端,启动相机外标定校准程序
$ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch
  • 新终端,打开车道检测程序
$ roslaunch turtlebot3_autorace_detect detect_lane.launch
  • 新终端,启动车道跟随程序
$ roslaunch turtlebot3_autorace_driving turtlebot3_autorace_control_lane.launch

演示视频

<iframe height=498 width=100% src="//player.bilibili.com/player.html?aid=719251224&bvid=BV1nQ4y1U7aH&cid=444588863&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号


标签: none