【复现】jake 3991/sonar-SLAM:用于多波束声纳机器人的水下SLAM

前言

jake 3991/sonar-SLAM:用于多波束声纳机器人的水下SLAM

一、sonar-SLAM 过程

1.python环境

sudo pip install cv_bridge gtsam matplotlib numpy opencv_python scikit_learn scipy Shapely tf tqdm pyyaml

message_filter 是roscpp和rospy的实用程序库。 它集合了许多的常用的消息“过滤”算法。

ROS系列(一):【环境配置】rosbag 包安装_安装rosbag-

pip install gnupg
pip install pycryptodome
pip install pycryptodomex
pip install pyyaml
pip install docutils 
pip install python-dateutil
pip install pyparsing  
pip install rosbag -i https://rospypi.github.io/simple/
pip install rospy -i https://rospypi.github.io/simple/

win10 + python3 + 安装rosbag & cv_bridge & sensor_msgs+解析bag文件生成pcd和图片

pip install sensor_msgs --extra-index-url https://rospypi.github.io/simple/

2.ros环境

ROS-Noetic是一个用于机器人软件开发的框架,全称为Robot Operating System Noetic。它是ROS(Robot Operating System)的一个版本,提供了一系列工具和库来支持机器人系统的开发、部署和运行。ROS-Noetic是ROS的第十一个正式版本,于2020年5月发布。
小鱼的一键安装系列 | 鱼香ROS

catkin-pybind11是ROS中的一个工具,用于在Python和C++之间进行交互。它基于pybind11库,允许开发者将C++代码封装为Python模块,并在ROS中使用这些模块。catkin-pybind11简化了ROS中Python和C++代码的集成过程,使得开发者可以更方便地编写跨语言的ROS软件。
pybind11的安装以及库的使用(ubuntu20.14)_ubuntu安装pybind11-

catkin-tools是ROS中的一个构建工具,用于构建和管理ROS软件包。它是对ROS中的catkin构建系统的增强版本,提供了更多的功能和灵活性。catkin-tools可以帮助开发者自动化构建过程,管理软件包之间的依赖关系,并提供了一组命令行工具来简化ROS软件包的开发和部署。它是ROS开发中常用的工具之一,被广泛应用于ROS社区中的项目。

sudo pip install catkin-tools

3.安装

【ROS笔记】工作空间(workspace)、功能包(package)的介绍及创建
Catkin工作空间 (重点)

mkdir -p ~/catkin_ws/src  # 创建了第二层级的文件夹src,这是放ROS软件包的地方
cd ~/catkin_ws/src        # 进入工作空间,catkin_make必须在工作空间这个路径上执行
catkin_init_workspace     # 初始化src目录,生成的CMakeLists.txt为功能包编译配置
#cd ~/catkin_ws   # 回到工作空间,catkin_make必须在工作空间下执行;
#catkin_make     # 开始编译,调用系统自动完成编译和链接过程,构建生成目标文件
#source ./devel/setup.bash
#echo $ROS_PACKAGE_PATH
#cd ./src
git clone https://github.com/jake3991/sonar-SLAM.git
git clone https://github.com/ethz-asl/libnabo.git
git clone https://github.com/ethz-asl/libpointmatcher.git
cd ./libpointmatcher
git checkout d478ef2eb33894d5f1fe84d8c62cec2fc6da818f
git clone https://github.com/jake3991/Argonaut.git 

catkin build 的使用-
catkin build和catkin_make的区别和使用-

ROS软件包:libnabo — ROS Package: libnabo
依赖性:- libnabo依赖于Eigen,一个现代的C++矩阵和线性代数库。- libnabo适用于Eigen的版本2或3。- libnabo还可以选择依赖于Boost(一个C++通用库)进行Python绑定。

按这里的教程操作:Ubuntu - libpointmatcher

下载和安装- MAVProxy文档

sudo apt-get install python3-dev python3-opencv python3-wxgtk4.0 python3-pip python3-matplotlib python3-lxml python3-pygame
pip3 install PyYAML mavproxy --user
echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc

Argonaut/INSTALL.md at master · jake3991/Argonaut

sudo rosdep init
rosdep update

rosdep的主要用途是安装工作空间中ros包的依赖,首先切换到工作空间下,然后运行下述命令即可安装该工作空间的所有依赖:

rosdep install --from-paths src --ignore-src -r -y

在这里插入图片描述

4.数据

需科学上网
https://drive.google.com/file/d/1nmiFfyk8mVssLqgac7BOe4_RPBP6Wnc9/view?usp=sharing

在这里插入图片描述

5.在线运行

10.ROS的基础单元:Node节点和Package包_哔哩哔哩_bilibili

source catkin_ws/devel/setup.bash
roslaunch bruce_slam slam.launch
rosbag play your_data.bag

报错1:No module named ‘bruce_slam’

问题1:没有catkin build
问题2:没有下载catkin版本的Pybind 11
解决:在src里git,然后build
在这里插入图片描述
在这里插入图片描述
git到ws/src:
wxmerkt/pybind11_catkin:Pybind 11的Catkin包装器
catkin build

Ubuntu20.04 编译 pcl1.8可能出现的问题_error: invalid initialization of reference of type-

set(PCL_DIR "/usr/include/pcl-1.10")
find_package(PCL 1.10 REQUIRED)

/usr/include/pcl-1.10/pcl/point_types.h:550:1: error: ‘plus’ is not a member of ‘pcl::traits’-

# 在bruce_slam 的cmake文件里添加
set(CMAKE_CXX_STANDARD 14)

几乎完成编译·问题#7 ·jake 3991/sonar-SLAM — Almost Completed Compile · Issue #7 · jake3991/sonar-SLAM
在这里插入图片描述

报错2:No module named ‘ros_numpy’

git 再 build

git clone https://github.com/eric-wieser/ros_numpy.git                    

eric-wieser/ros_numpy:用于将ROS消息转换为numpy数组和从numpy数组转换ROS消息的工具

报错3:No module named ‘sklearn’

pip install scikit-learn

报错4:AttributeError: ‘gtsam.gtsam.Rot3’ object has no attribute ‘quaternion’

gtsam · PyPI — gtsam · PyPI

GTSAM 4.2可以从python使用 pip install gtsam 。所有可用的轮子都可以在pypi上找到。

AttributeError:‘gtsam.gtsam.Rot3’ object has no attribute ‘quaternion’ ·问题#11 · jake3991/sonar-SLAM

pip install gtsam==4.1.1

报错5:AttributeError: module ‘numpy’ has no attribute ‘bool’.

AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.

报错6:*** stack smashing detected ***: terminated

看看是不是报错5的问题
之前运行正常,第二天突然又报错,尝试了重启虚拟机,删除又恢复catkin_ws/src/sonar-SLAM/bruce_slam/rviz/video.rviz后又正常运行

6.离线运行

source catkin_ws/devel/setup.bash
roslaunch bruce_slam slam.launch file:=path_to_data/your_data.bag

请添加图片描述

7.其他

不支持mapping_node.py中的占用网格映射系统
不能用mapping_node.py创建一个地图,它发布的主题似乎是空的
创建地图·问题#12 ·jake 3991/sonar-SLAM — creating a map · Issue #12 · jake3991/sonar-SLAM

这很正常这些标记警告通常存在,我们必须对标记做一些花哨的技巧,使这些漂亮的线条显示出来,RVIZ显示警告。
pcl导入错误·问题#9 ·jake 3991/sonar-SLAM — pcl import error · Issue #9 · jake3991/sonar-SLAM

  • 11
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

tfnmdmx

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值