
环境:Ubuntu 20.04 + ROS Noetic + OpenCV:4.2.0
1、创建工作空间mkdir -p kalibr_ws/src cd kalibr_ws/ source /opt/ros/noetic/setup.bash cd src/ catkin_init_workspace2、下载kalibr源码并编译
git clone https://github.com/ethz-asl/kalibr.git cd .. catkin_make -DCMAKE_BUILD_TYPE=Release -j4
编译过程中遇到相关问题:
- Could not find a package configuration file provided by "boost_python3"
解决方法:
https://github.com/ethz-asl/kalibr/issues/368
/kalibr/Schweizer-Messer/numpy_eigen/cmake/add_python_export_library.cmake:89 change list(APPEND BOOST_COMPonENTS python3) to list(APPEND BOOST_COMPonENTS python)
- /usr/include/python3.8/numpy/__multiarray_api.h:1541:35: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
1541 | #define NUMPY_import_ARRAY_RETVAL NULL
解决方法:
https://blog.csdn.net/zhaodeming000/article/details/119859124
在文件中kalibr/Schweizer-Messer/numpy_eigen/src/autogen_module/numpy_eigen_export_module.cpp添加
BOOST_PYTHON_MODULE(libnumpy_eigen)
{
using namespace boost::python;
// Without this import, the converter will segfault
#undef NUMPY_import_ARRAY_RETVAL
#define NUMPY_import_ARRAY_RETVAL
import_array();
-
/home/ubuntu/kalibr_ws/src/kalibr/aslam_offline_calibration/ethz_apriltag2/src/example/apriltags_demo.cpp:53:10: fatal error: libv4l2.h: No such file or directory
53 | #include
解决方法:
sudo apt-get install libv4l-dev
- error: ‘CV_CAP_PROP_frame_WIDTH’ was not declared in this scope 305 | m_cap.set(CV_CAP_PROP_frame_WIDTH, m_width);
解决方法:
https://blog.csdn.net/CGJustDoIT/article/details/108150459
在kalibr_ws/src/kalibr/aslam_offline_calibration/ethz_apriltag2/src/example/apriltags_demo.cpp中添加:
#include
#include
using namespace std; #include#include #include #include #include #include const string usage = "n" m_cap.set(cv::CAP_PROP_frame_WIDTH, m_width); m_cap.set(cv::CAP_PROP_frame_HEIGHT, m_height); cout << "Camera successfully opened (ignore error messages above...)" << endl; cout << "Actual resolution: " << m_cap.get(cv::CAP_PROP_frame_WIDTH) << "x" << m_cap.get(cv::CAP_PROP_frame_HEIGHT) << endl;
- error: ‘pid_t gettid()’ was declared ‘extern’ and later ‘static’ [-fpermissive]
解决方法:
-
error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
22 | _mask = cv::imread(maskFile, CV_LOAD_IMAGE_GRAYSCALE);
- /usr/include/boost/python/detail/destroy.hpp:20:9: error: ‘Eigen::Matrixbase<Derived>::~Matrixbase()
解决方法:
https://blog.csdn.net/weixin_48135525/article/details/117999358
change line 466 protected intopublic in /usr/include/eigen3/Eigen/src/Core/Matrixbase.h or /usr/local/include/eigen3/Eigen/src/Core/Matrixbase.h.
3、编译成功欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)