配置yolo

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

(2)修改uav0.yaml

camera_reading:

topic: /iris_0/stereo_camera/left/image_raw

运行

roslaunch px4 uav_intercept.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轴正方向

将yolo模型替换为无人机模型

现成无人机模型

无人机模型链接:https://github.com/chuanenlin/drone-net

下载其中yolo-drone.cfg和yolo-drone.weights,放在darknet_ros/yolo_network_config中,并在/darknet_ros/launch/task1.launch中替换路径

仿真中识别无人机效果不好,超过5m就识别不出来。 解决方法:1)增大仿真相机分辨率,2)需要使用labelme自己标注一些数据集重新训练

自己训练无人机模型

将训练好的yolo4-tiny-new.weights,放在darknet_ros/yolo_network_config中,并在/darknet_ros/launch/task1.launch替换network_param_file中对应的yolov4 -tiny-new.yaml

无人机群对抗策略

待调研

精彩内容

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: