赞
踩
1.框架
yolo框架使用darknet_ros,这个版本支持yolov3和yolov4的配置文件
2.报错
(1)CUDA报错
`nvcc fatal : Unsupported gpu architecture 'compute_30'.`
(1)查看显卡匹配型号:https://blog.csdn.net/u013308762/article/details/121658823
(2)查看显卡:nvidia-smi -a
==》NVIDIA GeForce GTX 1070匹配ARCH= -gencode arch=compute_61,code=sm_61
因此,修改darknet_ros/CMakeLists.txt的文件,将多余compute版本注释掉
${CUDA_NVCC_FLAGS};
-O3
#-gencode arch=compute_30,code=sm_30
#-gencode arch=compute_35,code=sm_35
#-gencode arch=compute_50,code=[sm_50,compute_50]
#-gencode arch=compute_52,code=[sm_52,compute_52]
-gencode arch=compute_61,code=sm_61
#-gencode arch=compute_62,code=sm_62
(2)OPENCV报错
/usr/local/include/opencv2/core/cvdef.h:485:1: error: unknown type name ‘namespace’
namespace cv {
^~~~~~~~~
修改如下https://zhuanlan.zhihu.com/p/36933700
3.配置文件
更改无人机模型和视觉输入
(1)修改task1.launch
<arg name="image" default="/iris_0/stereo_camera/left/image_raw" />
(2)修改uav0.yaml
camera_reading:
topic: /iris_0/stereo_camera/left/image_raw
roslaunch px4 multi_vehicle.launch
roslaunch darknet_ros task1.launch
cd ~/XTDrone/communication
python multirotor_communication.py iris 0
cd ~/catkin_ws_intercept/src/intercept/scripts
python hover.py iris 1 vel
cd ~/catkin_ws_intercept/src/intercept/scripts
python yolo_human_intercept.py iris 0
yolo_human_intercept.py
中采用视觉伺服控制,并使用pid方法控制速度
注意:做无人机速度控制时,摄像机方向(前方)为x轴正方向,左为y轴正方向
无人机模型链接:https://github.com/chuanenlin/drone-net
下载其中yolo-drone.cfg
和yolo-drone.weights
,并在task1.launch
中替换路径
仿真中识别无人机效果不好,超过5m就识别不出来。
解决方法:1)增大仿真相机分辨率,2)需要使用labelme自己标注一些数据集重新训练
待调研
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。