ROS合集(五)SVIn2 开源项目复现

SVIn2: An Underwater SLAM System using Sonar, Visual, Inertial, and Depth Sensor

这里是完整的复现流程,从环境配置到运行数据集,确保你能顺利复现 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

image-20250403141906491

5.Bug

5.1 Cannot find -lopengv

image-20250403113857384

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

image-20250403120118709

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

image-20250403133937028

修改成v1版本

image-20250403135150669

roslaunch okvis_ros svin_stereorig_v1.launchsvin_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>
### ROS2机械臂抓取开源项目的概述 针对ROS2环境下机械臂抓取任务,存在多个优秀的开源项目可供参考。这些项目不仅提供了详尽的文档说明和丰富的示例代码,还具备良好的社区支持体系。 #### 1. MoveIt2 MoveIt2 是一款广泛应用于工业和服务机器人的运动规划框架,在ROS2平台上实现了对各种品牌型号机械臂的支持。其功能强大,涵盖了路径规划、避障处理等多个方面,并且内置了大量的插件用于扩展系统的灵活性[^3]。 ```bash git clone https://github.com/ros-planning/moveit2.git -b main ~/moveit2_ws/src/ cd ~/moveit2_ws && colcon build --symlink-install source install/setup.bash ``` #### 2. Franka Emika Panda Arm with ROS2 Franka Emika公司官方维护了一个基于Panda机器人手臂的ROS2接口包,该资源包含了完整的安装指南以及一系列实用的教学案例,非常适合新手入门学习如何操作真实的硬件设备完成诸如物体识别与抓取的任务[^1]。 ```bash sudo apt-get update && sudo apt-get upgrade pip3 install pybullet vcs import src < panda_ros.yaml colcon build --packages-select franka_msgs franka_hw ros2 launch panda_bringup panda.launch.py ``` #### 3. TurtleBot4 Manipulation Package TurtleBot系列是教育领域内非常受欢迎的小型移动平台之一,最新版本集成了机械爪装置后能够执行简单的拾取动作。此套件附带了详细的配置文件和编程实例,帮助使用者快速搭建起一套简易而有效的实验环境来实践所学知识[^2]。 ```bash wget https://raw.githubusercontent.com/turtlebot/turtlebot4/main/install.sh chmod +x ./install.sh && ./install.sh ros2 launch turtlebot4_manipulation bringup_launch.py use_sim:=true world:="your_world_file" ```
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值