配置yolo
CUDA报错
bash
`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版本注释掉
bash
${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
OPENCV报错
bash
/usr/local/include/opencv2/core/cvdef.h:485:1: error: unknown type name 'namespace'
namespace cv {
^~~~~~~~~
修改如下https://zhuanlan.zhihu.com/p/36933700
更改无人机模型和视觉输入
(1)修改task1.launch
bash
<arg name="image" default="/iris_0/stereo_camera/left/image_raw" />
(2)修改uav0.yaml
bash
camera_reading:
topic: /iris_0/stereo_camera/left/image_raw
运行
c
roslaunch px4 multi_vehicle.launch
bash
roslaunch darknet_ros task1.launch
bash
cd ~/XTDrone/communication
python multirotor_communication.py iris 0
bash
cd ~/catkin_ws_intercept/src/intercept/scripts
python hover.py iris 1 vel
bash
cd ~/catkin_ws_intercept/src/intercept/scripts
python yolo_human_intercept.py iris 0
做无人机速度控制时,摄像机方向(前方)为x轴正方向,左为y轴正方向