自动驾驶小实验之Turtlebot3_Autopilot(Tensorflow, OpenCV, ROS, PID)

自动驾驶小实验之Turtlebot3_Autopilot

This is the final project in the 2021 Winter Camp of Cambridge University and I am following the Prof. Thomas.

Author: Beal.MS(河明山)

Date: 2021/2/25


目标检测

该模块由训练模型和应用模型组成。 训练模型的一部分主要由Tensorflow Api支持。 初步工作是对数据集进行校准和处理,然后根据Tensorflow Api中的目标检测训练步骤完成模型训练。 应用程序模型的一部分主要由Vision文件夹中的ROS精确张量流对象检测提供。 通过调用相机数据执行模型预测,最后将目标检测结果输出到图像。


Command:

# Training the model
$ python3 object_detection/model_main_tf2.py \
--pipeline_config_path="/home/hemingshan/auto_ws/src/vision/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/pipeline.config"\
--model_dir="/home/hemingshan/auto_ws/src/vision/training"\
--alsologtostderr\
$ python3 object_detection/export_inference_graph.py\
--input_type image_tensor \
--pipeline_config_path="/home/hemingshan/auto_ws/src/vision/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/pipeline.config" \
--trained_checkpoint_prefix="/home/hemingshan/auto_ws/src/vision/training/checkpoint.ckpt" \
--output_directory="/home/hemingshan/model"\
# Run the file
$ roslaunch turtlebot3_gazebo turtlebot3_autorace.launch
$ rosrun tensorflow_object_detector detect_ros.py 
$ rqt_image_view

调用tensorboard查看训练过程:

在这里插入图片描述


仿真结果:

在这里插入图片描述


路面检测

路面检测模块主要用于使汽车遵循交通规则以在道路范围内行驶。 此模块中有两种比较方法。 首先是使用opencv的图像处理和PID控制方法来完成模块的任务,但是通过下图,可以发现此方法将导致存在其他根据当前情况不会继续移动的路线 确定其他路线后的路线。 发生了 为了改进此方法,请调整摄像机的位置并将其对准地面,而不是像以前的方法那样面向前方,这表明摄像机的位置非常重要。


Command:

$ roslaunch turtlebot3_gazebo turtlebot3_auto.launch
$ rosrun tensorflow_object_detector detect_lane.py 

第一种方法:

在这里插入图片描述


第二种方法:

在这里插入图片描述

避障

在避障算法中,仅使用激光雷达测距的原理。 识别出障碍物后,将定位特定位置,最后通过简单的A *算法预测避障路线。

The result in the simulation:

在这里插入图片描述


最后,贴上我的Github地址:(https://github.com/MingshanHe/Autopilot-Demo.git)
欢迎大家私信探讨
还有,我的B站上也会有有趣的实验视频更新~

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值