自动驾驶

578 字
3 分钟
自动驾驶

模型训练等#

视频教程#

代码仓库#

https://github.com/ZTL123Z/traffic-detector-2025

image-20260415192658478
image-20260415192658478

训练模型#

  • 推荐算力云AutoDLhttps://www.autodl.com/

  • 学生认证还能成为==VIP==

  • 好处,==不用配置环境==,直接使用,==训练一次不要一元==

image-20260415193526964
image-20260415193526964

训练用的镜像如下,可以分享

image-20260415194105228
image-20260415194105228

租的服务器

image-20260415195735548
image-20260415195735548

==拉取镜像创建实例==

image-20260416144837649
image-20260416144837649

无卡模式开机配置环境

打标签的网站#

https://app.roboflow.com/

image-20260415195121592
image-20260415195121592

加入我后,把权限给你

有11个类别

image-20260415195916857
image-20260415195916857

运行命令#

启动测试#

Terminal window
# 1.启动底盘
roslaunch abot_driver abot_driver.launch
# 2.启动键盘,看轮胎
rosrun teleop_twist_keyboard teleop_twist_keyboard.py

camera.launch 摄像头#

<launch>
<param name="use_sim_time" value="false"/>
<arg name="camera_type" value="$(env CAMERA)"/>
<group if="$(eval arg('camera_type') == 'astra')">
<include file="$(find astra_camera)/launch/astra.launch"/>
</group>
<group if="$(eval arg('camera_type') == 'gemini')">
<include file="$(find astra_camera)/launch/gemini.launch"/>
</group>
<group if="$(eval arg('camera_type') == 'astrapro')">
<node name="uvc_camera_node" pkg="uvc_camera" type="uvc_camera_node" output="screen">
<remap from="/image_raw" to="/camera/rgb/image_raw" />
<remap from="/camera_info" to="/camera/rgb/camera_info" />
<param name="width" type="int" value="640" />
<param name="height" type="int" value="480" />
<param name="fps" type="int" value="30" />
<param name="frame" type="string" value="wide_stereo" />
<param name="auto_focus" type="bool" value="False" />
<param name="focus_absolute" type="int" value="0" />
<!-- other supported params: auto_exposure, exposure_absolute, brightness, power_line_frequency -->
<param name="device" type="string" value="/dev/video0" />
<param name="camera_info_url" type="string" value="file://$(find abot)/param/camera_calibration/camera.yaml" />
</node>
<node pkg="topic_tools" type="transform" name="compressed_image" args="/camera/rgb/image_raw/compressed /compressed_image sensor_msgs/CompressedImage 'm' --wait-for-start" required="true">
</node>
</group>
<group if="$(eval arg('camera_type') == 'usb')">
<node name="uvc_camera_node" pkg="uvc_camera" type="uvc_camera_node" output="screen">
<remap from="/image_raw" to="/camera/right/image_raw" />
<remap from="/camera_info" to="/camera/right/camera_info" />
<param name="width" type="int" value="640" />
<param name="height" type="int" value="480" />
<param name="fps" type="int" value="30" />
<param name="frame" type="string" value="wide_stereo" />
<param name="auto_focus" type="bool" value="False" />
<param name="focus_absolute" type="int" value="0" />
<!-- other supported params: auto_exposure, exposure_absolute, brightness, power_line_frequency -->
<param name="device" type="string" value="/dev/video4" />
<param name="camera_info_url" type="string" value="file://$(find uvc_camera)/example.yaml" />
</node>
<node name="uvc_camera_node1" pkg="uvc_camera" type="uvc_camera_node" output="screen">
<remap from="/image_raw" to="/camera/rgb/image_raw" />
<remap from="/camera_info" to="/camera/rgb/camera_info" />
<param name="width" type="int" value="640" />
<param name="height" type="int" value="480" />
<param name="fps" type="int" value="30" />
<param name="frame" type="string" value="wide_stereo" />
<param name="auto_focus" type="bool" value="False" />
<param name="focus_absolute" type="int" value="0" />
<param name="device" type="string" value="/dev/video2" />
<param name="camera_info_url" type="string" value="file://$(find uvc_camera)/example.yaml" />
</node>
<node name="uvc_camera_node2" pkg="uvc_camera" type="uvc_camera_node" output="screen">
<remap from="/image_raw" to="/camera/back/image_raw" />
<remap from="/camera_info" to="/camera/back/camera_info" />
<param name="width" type="int" value="640" />
<param name="height" type="int" value="480" />
<param name="fps" type="int" value="30" />
<param name="frame" type="string" value="wide_stereo" />
<param name="auto_focus" type="bool" value="False" />
<param name="focus_absolute" type="int" value="0" />
<param name="device" type="string" value="/dev/video0" />
<param name="camera_info_url" type="string" value="file://$(find uvc_camera)/example.yaml" />
</node>
</group>
<group if="$(eval arg('camera_type') == 'csi')">
<include file="$(find jetson_camera)/launch/jetson_camera.launch"/>
<node pkg="topic_tools" type="transform" name="compressed_image" args="/camera/rgb/image_raw/compressed /compressed_image sensor_msgs/CompressedImage 'm' --wait-for-start" required="true">
</node>
</group>
<group if="$(eval arg('camera_type') == 'intel')">
<include file="$(find realsense2_camera)/launch/rs_rgbd.launch" />
<node pkg="topic_tools" type="transform" name="compressed_image" args="/camera/color/image_raw/compressed /compressed_image sensor_msgs/CompressedImage 'm' --wait-for-start" respawn="true" />
</group>
</launch>

摄像头一次3个

Terminal window
abot@robot:~/桌面$ ls /dev/video*
/dev/video0 /dev/video1 /dev/video2 /dev/video3 /dev/video4 /dev/video5

摄像头没有问题,查看摄像头画面#

启动摄像头#

Terminal window
abot@robot:~/桌面$ roslaunch abot camera.launch

查看摄像头画面#

Terminal window
abot@robot:~/桌面$ rosrun rqt_image_view rqt_image_view

摄像头的插入顺序#

后面,前面,左右两边

这样插入,摄像头的名称就对应

启动比赛代码#

Terminal window
abot@robot:~/桌面$ rosrun traffic_detector core_new.py

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!

赞助
自动驾驶
https://ztl123z.github.io/posts/自动驾驶四摄像头小车/
作者
三叶草
发布于
2026-04-15
许可协议
CC BY-NC-SA 4.0

评论区

Profile Image of the Author
三叶草
Hello, I'm Clover.
公告
欢迎来到三叶草☘️的博客
音乐
封面

音乐

暂未播放

0:00 0:00
暂无歌词
分类
标签
站点统计
文章
47
分类
14
标签
53
总字数
52,789
运行时长
0
最后活动
0 天前

目录