赞
踩
将代码放在了catkin_ws->src->robot_vision->scripts 【以后都把代码放在这里】
连Zed相机
在/usr/local/zed/tools中,运行./ZED_Diagnostic
【如何找到local文件夹:other locations->computer->usr->local->zed->tools】
项目一:
项目一代码darknet_zed.py 识别物体 加边框 标签 距离
项目一权重放的位置zed-yolo->Libdarknet下yolov3.weights和yolov3-tiny.weights
Yolo、ROS与Zed的结合
【Q1】连相机的过程中出现错误:cuda不见了(可能是之前运行过程中突然会崩)
yingyuxi@yingyuxi-GE66-Raider-10SF:/usr/local/cuda/samples/1_Utilities/deviceQuery$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 999
-> unknown error
Result = FAIL
解决方法:
$ sudo apt-get update (有事没事就更新)
然后重启
cd进入/usr/local/cuda/samples/1_Utilities/deviceQuery文件夹(Cuda的相关文件夹)
yingyuxi@yingyuxi-GE66-Raider-10SF:/usr/local/cuda/samples/1_Utilities/deviceQuery$ sudo make clean
yingyuxi@yingyuxi-GE66-Raider-10SF:/usr/local/cuda/samples/1_Utilities/deviceQuery$ sudo make
yingyuxi@yingyuxi-GE66-Raider-10SF:/usr/local/cuda/samples/1_Utilities/deviceQuery$ ./deviceQuery
这三步检验cuda是否安装成功
调用摄像头 跑代码
yingyuxi@yingyuxi-GE66-Raider-10SF:~/catkin_ws$ roscore
再打开另一个终端
yingyuxi@yingyuxi-GE66-Raider-10SF:~$ cd catkin_ws
yingyuxi@yingyuxi-GE66-Raider-10SF:~/catkin_ws$ rosrun robot_vision darknet_zed.py
按Q退出
项目二:Yolo
./darknet detect cfg/yolov4.cfg yolov4.weights data/dog.jpg 【要进入darknet文件夹下cd开终端】
./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights -i 0 -thresh 0.25
选中框按esc退出
项目三:用ROS调用ZED
参考:https://www.stereolabs.com/docs/ros/
在wandorbot_ws/src中 git clone https://github.com/stereolabs/zed-ros-wrapper.git 与 git clone https://github.com/stereolabs/zed-ros-examples.git
cd .. ; rosdep install --from-paths src --ignore-src -r -y.
或者在src文件夹下:rosdep install -y --from-paths ~/wanderbot/src --ignore-src -r
catkin_make -DCMAKE_BUILD_TYPE=Release
如上述语句不行,则直接catkin_make
完成后source devel/setup.bash
执行以下几步:
yingyuxi@yingyuxi-GE66-Raider-10SF:~/wanderbot_ws$ source devel/setup.bash
roslaunch zed_wrapper zed2.launch
重开终端
yingyuxi@yingyuxi-GE66-R
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。