视觉惯性里程计(VIO)
Ceres Solver 2.0.0(依赖安装)
1.在GitHub下载:https://github.com/ceres-solver/ceres-solver/tags
2. 下载后解压到home目录下,并将文件夹名修改为:ceres-solver-2.0.0 我不确定home是不是对应主目录,反正我是放在主目录下了
3. 依赖安装
# CMake
sudo apt-get install -y cmake
# google-glog + gflags
sudo apt-get install -y libgoogle-glog-dev libgflags-dev
# BLAS & LAPACK
sudo apt-get install -y libatlas-base-dev
# Eigen3
sudo apt-get install -y libeigen3-dev
# SuiteSparse and CXSparse (optional)
sudo apt-get install -y libsuitesparse-dev
- 编译
cd ceres-solver-2.0.0
mkdir ceres-bin
cd ceres-bin
cmake ..
make -j8
make test
sudo make install
cmake… 本来参考这个博客用的是cmake …/ceres-solver-2.0.0,报错了
就按这个博客修改了
make -j8成功后显示如下:
make test成功后显示:
sudo make install成功后显示:
至此Ceres-solver-2.0.0安装完毕
VINS-Fusion编译
cp -r ~/XTDrone/sensing/slam/vio/VINS-Fusion ~/catkin_ws/src/
mkdir ~/catkin_ws/scripts/
cp ~/XTDrone/sensing/slam/vio/xtdrone_run_vio.sh ~/catkin_ws/scripts/
cd ~/catkin_ws
catkin_make #或catkin build,取决于您的编译工具
VINS-Fusion仿真
注意把EKF设置为视觉定位,详见PX4飞控EKF配置教程。
启动仿真程序,注意launch文件中使用的是iris_stereo_camera.sdf
roslaunch px4 indoor1.launch
启动VINS-Fusion,注意其默认订阅的话题是iris_0的,如果要换别的vehicle,需要对应修改。另外临时文件存储路径也要对应修改。(这里我都没改)
gedit ~/catkin_ws/src/VINS-Fusion/config/xtdrone_sitl/px4_sitl_stereo_imu_config.yaml
cd ~/catkin_ws
bash scripts/xtdrone_run_vio.sh
这时VINS-Fusion就启动了
由于VINS-Fusion发布的是Odometry类型的话题,我们要将其对应转为PX4所需的话题
cd ~/XTDrone/sensing/slam/vio
python vins_transfer.py iris 0
然后建立通信,键盘控制起飞即可
cd ~/XTDrone/communication
python multirotor_communication.py iris 0
cd ~/XTDrone/control/keyboard
python multirotor_keyboard_control.py iris 1 vel
视觉惯性里程计(VIO)