3D-激光SLAM笔记
目录
定位方案
编译tbb
ros2humble安装
命令 colcon commond not found
栅格地图生成:
evo画轨迹曲线
安装gtsam4.0.2
安装ceres-solver1.14.0
定位方案
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