SVIn2: An Underwater SLAM System using Sonar, Visual, Inertial, and Depth Sensor
文章目录
- https://github.com/AutonomousFieldRoboticsLab/SVIn/tree/ros1 ros1版本
- https://drive.google.com/drive/folders/14LEMMigHxHRGESOZNudUM4LuxXFGLVmE 数据集
这里是完整的复现流程,从环境配置到运行数据集,确保你能顺利复现 SVIn2 项目。
Ubuntu 20.04 LTS
ROS 1 Noetic
1. 安装必要的软件
安装额外的 ROS 依赖
sudo apt install -y ros-noetic-pcl-ros ros-noetic-tf2-sensor-msgs
2. 安装所需的库
2.1 安装 CMake
sudo apt install -y cmake
2.2 安装 Google glog/gflags、BLAS、LAPACK 和 Eigen3
sudo apt install -y libgoogle-glog-dev libatlas-base-dev libeigen3-dev
2.3 安装 SuiteSparse、CXSparse、OpenCV 和 Boost
sudo apt install -y libsuitesparse-dev libopencv-dev
sudo apt install -y libboost-dev libboost-filesystem-dev
2.4 安装 Ceres Solver
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
git checkout 1.14.x
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
sudo make install
cd ../..
2.5 安装 BRISK 特征点检测
wget https://www.doc.ic.ac.uk/~sleutene/software/brisk-2.0.8.zip
unzip brisk-2.0.8.zip
cd brisk
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
sudo make install
cd ../..
3. 下载和编译 SVIn2 项目
3.1 创建 ROS 工作空间
mkdir -p ~/svin_ws/src
cd ~/svin_ws/src
3.2 克隆 SVIn2 及其依赖
git clone --branch 0.2 https://github.com/AutonomousFieldRoboticsLab/SVIn.git
git clone https://github.com/AutonomousFieldRoboticsLab/imagenex831l.git
git clone --branch ros-noetic https://github.com/AutonomousFieldRoboticsLab/sonar_rviz_plugin.git
3.3 编译项目
cd ~/svin_ws
catkin_make
source devel/setup.bash
4. 运行数据集
4.1 下载测试数据集
SVIn2 提供的数据集在 此处。
在 Google Drive 中,找到 “Bus” 和 “Cave” 目录,下载 .bag
文件。
假设下载到 ~/datasets
目录。
mkdir -p ~/SVln2/svin_ws/datasets
cd ~/SVln2/svin_ws/datasets
# (手动下载并存放 bag 文件)
4.2 运行 Cave 数据集
cd ~/SVln2/svin_ws
source ~/SVln2/svin_ws/devel/setup.bash
roslaunch okvis_ros svin_stereorig_v2.launch
在另一个终端窗口中,回放 Cave
数据:
source ~/svin_ws/devel/setup.bash
rosbag play ~/datasets/Cave.bag --clock -r 0.8
4.3 运行 Bus 数据集
cd ~/SVln2/svin_ws
source ~/SVln2/svin_ws/devel/setup.bash
roslaunch okvis_ros svin_stereorig_v1.launch
在另一个终端窗口中,回放 Bus
数据:
source ~/svin_ws/devel/setup.bash
cd ~/SVln2/svin_ws/datasets/Bus/
rosbag play bus_out_loop_w_cam_info.bag --clock -r 0.8
5.Bug
5.1 Cannot find -lopengv
https://debian.pkgs.org/12/debian-main-arm64/libopengv-dev_1.0+1git91f4b1-7+b1_arm64.deb.html
https://github.com/laurentkneip/opengv
你可以尝试手动编译 OpenGV 并安装它,以解决 cannot find -lopengv
的问题。请按照以下步骤操作:
1、下载 OpenGV
git clone https://github.com/laurentkneip/opengv.git
cd opengv
2、 创建 build
目录
mkdir build
cd build
3、编译 OpenGV
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc) # 使用所有可用 CPU 线程加速编译
sudo make install
5.2 Could not open config file config_stereo_rig_aprilgrid.yaml
Could not open config file: /home/zhanyong/SVln2/svin_ws/src/SVIn/okvis_ros/okvis/config/config_stereo_rig_aprilgrid.yaml
修改成v1版本
在roslaunch okvis_ros svin_stereorig_v1.launch
的svin_stereorig_v1.launch
内容如下 config_stereo_rig_aprilgrid.yaml
已经不存在了,使用v1替换
<launch>
<!-- Arguments -->
<arg name="config_path" default="$(find pose_graph)/config/stereo_rig/stereo_rig_config.yaml" />
<param name="/use_sim_time" value="true" />
<!-- To un-compress image topics -->
<node name="republish1" type="republish" pkg="image_transport" output="screen"
args="compressed in:=/slave1/image_raw raw out:=/cam0/image_raw" />
<node name="republish2" type="republish" pkg="image_transport" output="screen"
args="compressed in:=/slave2/image_raw raw out:=/cam1/image_raw" />
<!-- Run pose_graph node-->
<node name="pose_graph_node" pkg="pose_graph" type="pose_graph_node" output="screen">
<param name=" config_file" type="string" value="$(arg config_path)" />
</node>
<node name="okvis_node" pkg="okvis_ros" type="okvis_node">
<!-- <param name="config_filename" value="$(find okvis_ros)/okvis/config/config_stereo_rig_aprilgrid.yaml" />
-->
<param name="config_filename" value="$(find okvis_ros)/okvis/config/config_stereorig_v1.yaml" />
<param name="mesh_file" value="firefly.dae" />
<remap from="/camera0" to="/cam0/image_raw" />
<remap from="/camera1" to="/cam1/image_raw" />
<remap from="/imu" to="/imu/imu" />
</node>
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find okvis_ros)/config/rviz_svin.rviz" />
</launch>