ROS 自动驾驶-车道检测
本片文章主要說(shuō)明介紹了如何使用車道檢測(cè)功能以及如何通過(guò)rqt校準(zhǔn)攝像機(jī)。
車道檢測(cè)
車道檢測(cè)軟件包允許Turtlebot3在兩個(gè)車道之間行駛,而不受外部影響,詳細(xì)操作步驟如下:
1.將TurtleBot3放在黃色和白色車道之間。
注意:確保黃色通道位于機(jī)器人的左側(cè),白色通道位于機(jī)器人的右側(cè)。
2.在Remote PC上新終端,啟動(dòng)roscore
roscore
3.在SBC上新終端,開啟相機(jī)
roslaunch turtlebot3_autorace_traffic_light_camera turtlebot3_autorace_camera_pi.launch
4.在Remote PC上新終端,運(yùn)行相機(jī)固有的校準(zhǔn)啟動(dòng)文件。
export AUTO_IN_CALIB=action export GAZEBO_MODE=false roslaunch turtlebot3_autorace_traffic_light_camera turtlebot3_autorace_intrinsic_camera_calibration.launch
5.在Remote PC上新終端,運(yùn)行外部相機(jī)校準(zhǔn)啟動(dòng)文件。
export AUTO_EX_CALIB=action roslaunch turtlebot3_autorace_traffic_light_camera turtlebot3_autorace_extrinsic_camera_calibration.launch
6.在Remote PC上新終端,運(yùn)行車道檢測(cè)啟動(dòng)文件
export AUTO_DT_CALIB=calibration roslaunch turtlebot3_autorace_traffic_light_detect turtlebot3_autorace_detect_lane.launch
7.在Remote PC上新終端,執(zhí)行rqt。
rqt
8.單擊plugins>visualization>Image view將出現(xiàn)多個(gè)窗口
9.選擇在每個(gè)圖像視圖中的三個(gè)主題:
/detect/image_yellow_lane_marker/compressed
/detect/image_lane/compressed
/detect/image_white_lane_marker/compressed
左(黃線)和右(白線)屏幕顯示已過(guò)濾的圖像
10.在Remote PC上新終端,執(zhí)行rqt_reconfigure。
rosrun rqt_reconfigure rqt_reconfigure
11.單擊detect lane,然后調(diào)整參數(shù)以進(jìn)行線條顏色過(guò)濾。
12.打開文件turtlebot3_autorace_detect/param/lane/lane.yaml文件,將您需要修改后的值寫入文件。這將使相機(jī)在下次啟動(dòng)時(shí)按照此處設(shè)置的方式設(shè)置其參數(shù)。
提示:由于物理環(huán)境(例如房間中的光線亮度等)的影響,有時(shí)有時(shí)很難進(jìn)行線色過(guò)濾的校準(zhǔn)過(guò)程。要快速制作所有內(nèi)容,可以參考
turtlebot3_autorace_detect/param/lane/lane.yaml里面的參數(shù)值,然后開始校準(zhǔn)。
首先校準(zhǔn)色相hue_l、hue_h值。hue是指顏色,如yellow,white,具有自己的色相值區(qū)域(請(qǐng)參閱hsv貼圖)。
然后校準(zhǔn)飽和度saturation_l、saturation_h值。每種顏色都有各自的飽和度場(chǎng)。
最后,校準(zhǔn)亮度lightness_l、lightness_h值,由于在源代碼中具有自動(dòng)調(diào)整功能,因此將亮度低值校準(zhǔn)是沒有意義的。只需將亮度高值lightness_h設(shè)置為255。清晰過(guò)濾的線圖像將使您獲得清晰的車道結(jié)果。
13.關(guān)閉rqt_rconfigure和turtlebot3_autorace_detect_lane。
車道識(shí)別實(shí)際測(cè)試
14.Remote PC打開新終端并在上使用命令
export AUTO_DT_CALIB=action roslaunch turtlebot3_autorace_traffic_light_detect turtlebot3_autorace_detect_lane.launch
15.檢查結(jié)果是否正確顯示。
Remote PC打開新終端并在上使用命令
roslaunch turtlebot3_autorace_traffic_light_control turtlebot3_autorace_control_lane.launch
16.Remote PC打開新終端并在上使用命令
roslaunch turtlebot3_bringup turtlebot3_robot.launch
使用命令后,TurtleBot3將開始運(yùn)行。
總結(jié)
以上是生活随笔為你收集整理的ROS 自动驾驶-车道检测的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ls 命令查看文件时候,按修改时间倒序或
- 下一篇: idea安装Jrebel步骤