cartographer的安装

本文提供了一个bash脚本,指导用户在Ubuntu系统上快速安装Cartographer、CeresSolver、protobuf等依赖,以及如何在ROS环境中进行测试。
摘要由CSDN通过智能技术生成

install_carto.sh:

```bash
#!/bin/bash
# cyun 一键安装cartographer源码环境
# 2024.3.6
# 需要git可用(科学上网)

# 1. 安装依赖
sudo apt-get update
sudo apt-get install -y \
    cmake \
    g++ \
    git \
    google-mock \
    libboost-all-dev \
    libcairo2-dev \
    libeigen3-dev \
    libgflags-dev \
    libgoogle-glog-dev \
    liblua5.2-dev \
    libprotobuf-dev \
    libsuitesparse-dev \
    libwebp-dev \
    ninja-build \
    protobuf-compiler \
    sphinx-common



cd ~/Documents
if [ ! -d "ceres-solver" ]; then
    git clone https://github.com/ceres-solver/ceres-solver.git
fi
echo "ceres Document Ready" 
cd ceres-solver
git checkout 1.14.x
mkdir -p build
cd build
if [ ! -f "Makefile" ]; then
    cmake ..
fi
make -j16
sudo make install



cd ~/Documents
if [ ! -d "protobuf" ]; then
    git clone https://github.com/google/protobuf.git
fi
echo "protobuf Document Ready" 
cd protobuf
git checkout v3.6.1
mkdir -p build
cd build
if [ ! -f "Makefile" ]; then
    cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF ../cmake
fi
make -j16
sudo make install


cd ~/Documents
if [ ! -d "cartographer" ]; then
    git clone https://gitee.com/BlueWhaleRobot/cartographer.git
fi
cd cartographer
mkdir -p build
cd build
if [ ! -f "Makefile" ]; then
    cmake ..
fi
make -j16
sudo make install


cd ~/forklift_ws/src
if [ ! -d "cartographer_ros" ]; then
    git clone https://git.bwbot.org/publish/cartographer_ros
fi
cd ..
catkin_make



cd ~/forklift_ws/src
if [ ! -d "Hybrid_A_Star" ]; then
    git clone https://github.com/zm0612/Hybrid_A_Star
fi
cd ..
catkin_make


cd ~/forklift_ws/src
if [ ! -d "pointcloud_to_laserscan" ]; then
    git clone https://github.com/BluewhaleRobot/pointcloud_to_laserscan.git
fi
cd ..
catkin_make



echo "脚本执行完毕"
echo "2D:"
echo "wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag"
echo "测试命令:source ros 环境;roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:='/home/cyun/Downloads/cartographer_paper_deutsches_museum.bag'"

echo "3D:"
echo "wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/with_intensities/b3-2016-04-05-14-14-00.bag"
echo "roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag"

chmod +x给到权限,执行:

./install_carto.sh:

满足条件的话基本可以一键安装cartographer。
给出了测试用的数据和命令。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

白云千载尽

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

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

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

打赏作者

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

抵扣说明:

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

余额充值