一、在使用视觉检测模块报错
error: ‘CV_FOURCC’ was not declared in this scope
149 | cap.set(CAP_PROP_FOURCC, CV_FOURCC('G', 'R', 'E', 'Y'));
解决方法:
CV_FOURCC
是OpenCV中用于设置视频编解码器的宏,但在新版本的OpenCV中已被移除。取而代之的是使用cv::VideoWriter::fourcc
来设置四字符编码器。
可以按照以下步骤修改代码:
1.导入cv::VideoWriter
类
#include <opencv2/opencv.hpp>
2.使用cv::VideoWriter::fourcc
来设置四字符编码器:
cap.set(CAP_PROP_FOURCC, cv::VideoWriter::fourcc('G', 'R', 'E', 'Y'));
二、在运行roslaunch prometheus_gazebo sitl_landing_static_target.launch时报错
RLException: [sitl_landing_static_target.launch] is neither a launch file in package [prometheus_gazebo] nor is [prometheus_gazebo] a launch file name
The traceback for the exception was written to the log file
解决方法
添加工程环境变量
打开终端进入bashrc
sudo gedit ~/.bashrc
在bashrc后添加ROS路径
source ~/Prometheus/devel/setup.bash
export ROS_PACKAGE_PATH=/opt/ros/noetic/:~/Prometheus/
重启bashrc
source ~/.bashrc