3D-激光SLAM笔记

06-01 1052阅读

目录

定位方案

编译tbb

ros2humble安装

命令 colcon commond not found

栅格地图生成:

evo画轨迹曲线

安装gtsam4.0.2

安装ceres-solver1.14.0


3D-激光SLAM笔记

定位方案

1 方案一:改动最多

fasterlio 建图,加闭环优化,参考fast-lio增加关键帧

定位: 用读入pcd点云,创建体素ivox结构地图,用ieskf ikfom ivox结构紧耦合匹配输出位姿

重定位:用读入pcd点云,创建体素ivox结构,给定初始位姿用ieskf定位

栅格地图生成:用octomap mapserver生成,离线。或改为在线生成。

2 方案二:直接测试

建图:fastlio 建图,fast-lio-slam 包含闭环和优化

定位/重定位:用fast-lio-localization包含定位功能,配合open3d

栅格地图生成:用octomap mapserver生成,离线。或改为在线生成。

3 方案三:改动多

建图:fasterlio,加闭环优化,参考fast-lio增加关键帧

定位重定位:参考《自动驾驶与机器人中的slam技术》十讲,进行前端融合。

栅格地图生成:用octomap mapserver生成,离线。或改为在线生成。

4 方案四:入门级别

建图、定位、重定位:参考《自动驾驶与机器人中的slam技术》九讲十讲

栅格地图生成:用octomap mapserver生成,离线。或改为在线生成。

编译tbb

make compiler=gcc-9 stdver=c++17 tbb_build_prefix=my_tbb_build

sudo mkdir /usr/local/oneTBB-2019_U8

sudo cp -r include /usr/local/oneTBB-2019_U8/include

sudo ln -s /usr/local/oneTBB-2019_U8/include/tbb /usr/local/include/tbb

sudo cp -r build/my_tbb_build_release /usr/local/oneTBB-2019_U8/lib

sudo ln -s /usr/local/oneTBB-2019_U8/lib/libtbb.so.2 /usr/local/lib/libtbb.so

sudo ln -s /usr/local/oneTBB-2019_U8/lib/libtbbmalloc.so.2 /usr/local/lib/libtbbmalloc.so

sudo ln -s /usr/local/oneTBB-2019_U8/lib/libtbbmalloc_proxy.so.2      /usr/local/lib/libtbbmalloc_proxy.so

echo 'export LD_LIBRARY_PATH=/usr/local/oneTBB-2019_U8/lib:$LD_LIBRARY_PATH'  >>      ~/.bashrc

source ~/.bashrc

/usr/local/lib/libtbb.so

/usr/local/lib/libtbbmalloc.so

/usr/local/lib/libtbbmalloc_proxy.so

ros2humble安装

1.首先将本地的编码格式修改为utf-8

sudo apt update && sudo apt install locales

sudo locale-gen en_US en_US.UTF-8

sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8

export LANG=en_US.UTF-8

2.添加ROS2 GPG key

sudo apt update && sudo apt install curl -y

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

3.安装ROS2

sudo apt update

sudo apt upgrade

sudo apt install ros-humble-desktop

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc 

source ~/.bashrc  #使环境生效

wget http://fishros.com/install -O fishros && . fishros

 rosdepc update

命令 colcon commond not found

 pip3 install -U colcon-common-extensions

 sudo apt update && sudo apt install -y \

  build-essential \

  cmake \

  git \

  python3-colcon-common-extensions \

  python3-pip \

  python-rosdep \

  python3-vcstool

栅格地图生成:

octomap 安装

sudo apt-get install ros-melodic-octomap-ros

sudo apt-get install ros-melodic-octomap-msgs

sudo apt-get install ros-melodic-octomap-server

sudo apt-get install ros-melodic-octomap-rviz-plugins

map_server 安装

sudo apt-get install ros-melodic-map-server

 

evo画轨迹曲线

 tum格式是 time x y z qx qy qz qw   KITTI格式的数据通常是一个4x4的变换矩阵 ‌   不包含时间戳

pip install evo --upgrade --no-binary evo

evo_traj tum --ref=gt.txt 1.txt 2.txt 3.txt  -a  -p  --save_plot  ./output.pdf

evo_traj tum --ref=traj.txt optimized_poses.txt  -a  -p  --save_plot  ./output.pdf

evo_traj tum traj.txt  -a  -p  --save_plot  ./output.pdf

轨迹对比

evo_traj tum --ref=bef.txt aft.txt  -a  -p  --save_plot  ./output.pdf

绝对差

evo_ape tum bef.txt aft.txt   -va -p 

安装gtsam4.0.2

wget -O ~/Downloads/gtsam.zip https://github.com/borglab/gtsam/archive/4.0.2.zip

cd ~/Downloads/ && unzip gtsam.zip -d ~/Downloads/

cd ~/Downloads/gtsam-4.0.2/

mkdir build && cd build

cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..

sudo make install -j4

安装ceres-solver1.14.0

sudo apt-get install -y libgoogle-glog-dev

sudo apt-get install -y libatlas-base-dev

wget -O ~/Downloads/ceres.zip https://github.com/ceres-solver/ceres-solver/archive/1.14.0.zip

cd ~/Downloads/ && unzip ceres.zip -d ~/Downloads/

cd ~/Downloads/ceres-solver-1.14.0

mkdir ceres-bin && cd ceres-bin

cmake ..

sudo make install -j4

免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们。

目录[+]

取消
微信二维码
微信二维码
支付宝二维码