Turtlebot3自动驾驶2020仿真教程-车道识别
目录
Table of Contents
Software Installation
Camera Exterior Calibration
Lane Detection
Object Recognition
Traffic Light Detection
Cross-Road Navigation
Construction Zone Handling
Automated Parking
Traffic Pole Recognition
Tunnel Simulation
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 → Visualization → Image view界面,并依次创建并配置三个窗口,在其对应的参数设置中分别订阅/d subscribe /d订阅 /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_l和hue_white_h
然后校准饱和度高低值:lightness_white_l和saturation_white_h的
最后一步是调节亮度高低参数:lightness_white_l$ 和 saturation_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
