1. 相机颜色不正确
cd hik_camera_driver
vim src/mvs_ros_pkg/src/grab_trigger_new.cpp
nRet = MV_CC_GetImageForRGB(handle, pData, nBufSize, &stImageInfo, 1000);
启动相机:
source devel/setup.bash
roslaunch mvs_ros_pkg mvs_camera_trigger.launch
2. LET-NET VINS-mono 代码
copy 到 目录下:
rm src/CMakeLists.txt
catkin_make
报错:
CMake Error at xx/camera_model/CMakeLists.txt:19 (find_package):
By not providing "FindCeres.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Ceres", but
CMake did not find one.
Could not find a package configuration file provided by "Ceres" with any of
the following names:
CeresConfig.cmake
ceres-config.cmake
Add the installation prefix of "Ceres" to CMAKE_PREFIX_PATH or set
"Ceres_DIR" to a directory containing one of the above files. If "Ceres"
provides a separate development package or SDK, be sure it has been
installed.
http://ceres-solver.org/installation.html#linux
手动下载:
https://ceres-solver.googlesource.com/ceres-solver/+/refs/tags/2.2.0
下载 tgz
或者:
git clone https://ceres-solver.googlesource.com/ceres-solver
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse (optional)
sudo apt-get install libsuitesparse-dev
cd ceres-solver
mkdir ceres-bin
cd ceres-bin
cmake ..
make -j8
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
sudo make install
附加驱动安装 nvidia 驱动
重启
nvidia-smi 检验
安装 ncnn: https://www.cnblogs.com/odesey/p/18237733
报错:
CMake Error at VINS-Mono-LET-Net/feature_tracker/CMakeLists.txt:20 (find_package):
By not providing "Findncnn.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "ncnn", but
CMake did not find one.
Could not find a package configuration file provided by "ncnn" with any of
the following names:
ncnnConfig.cmake
ncnn-config.cmake
Add the installation prefix of "ncnn" to CMAKE_PREFIX_PATH or set
"ncnn_DIR" to a directory containing one of the above files. If "ncnn"
provides a separate development package or SDK, be sure it has been
installed.
vim src/VINS-Mono-LET-Net/feature_tracker/CMakeLists.txt
set(ncnn_DIR "/home/xx/programs/ncnn/build/install/lib/cmake/ncnn" CACHE PATH "Directory that contains ncnnConfig.cmake")
export ncnn_DIR=/home/xx/programs/ncnn/build/install/lib/cmake/ncnn
需要安装 opencv3.x
更新 opencv 3.4.20: https://www.cnblogs.com/odesey/p/18237733
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "cv_bridge" with
any of the following names:
cv_bridgeConfig.cmake
cv_bridge-config.cmake
https://www.cnblogs.com/odesey/p/18237733
报错:fatal error: ceres/local_parameterization.h: 没有那个文件或目录
4 | #include "ceres/local_parameterization.h"
解决:https://github.com/chichengcn/gici-open/issues/4#issuecomment-1626684365
ceres-solver 2.2 版本不行,降级到1.14.0版本
Ceres卸载
Ceres只有一个库文件在"/usr/local/lib/“中,并且所有的头文件都在”/usr/local/include/ceres/"中,卸载就是很简单的两步:
sudo rm -r /usr/local/lib/cmake/Ceres
sudo rm -rf /usr/local/include/ceres /usr/local/lib/libceres.a
git tag
git checkout 1.14.0
cd ceres-bin/
cmake ..
make -j$(nproc)
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
sudo make install
vim package.xml # 可以看到版本
ROS noetic 版本中自带的 OpenCV4 和 VINS-mono 中需要使用的 OpenCV3 冲突 的问题.
安装 ros noetic 后:
pkg-config opencv4 --modversion
4.2.0
我们自己装的:
pkg-config opencv --modversion
3.4.20
这会导致冲突。编译报错。
pose_graph/src/ThirdParty/DVision/BRIEF.cpp:53:32: error: ‘CV_RGB2GRAY’ was not declared in this scope
#include <opencv2/imgproc/types_c.h>
pose_graph.cpp:312:97: error: ‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope
CV_FONT_HERSHEY_SIMPLEX参数改为cv::FONT_HERSHEY_SIMPLEX
IMU 读取
cd lidar_color_map
sudo chmod 777 /dev/ttyUSB0
roslaunch livox_ros_driver livox_lidar.launch
因为环境不兼容问题,我的 特征跟踪模块无法启动。该方案已经放弃。
标签:ceres,cmake,package,相机,Ceres,IMU,ncnn,install,搭建 From: https://www.cnblogs.com/odesey/p/18281252