Cartographer-slam

 下载依赖包

谷歌开发的地图绘制软件包支持0.2.0版本的ROS1 Kinetic。因此,如果你需要在Kinetic上使用Cartogrpher,你应该下载并构建如下的源代码,而不是安装二进制软件包。有关更详细的安装说明,请参阅官方wiki页面。

Kinetic

1
2
3
4
5
6
7
8
9
sudo apt-get install ninja-build libceres-dev libprotobuf-dev protobuf-compiler libprotoc-dev
cd ~/catkin_ws/src
git clone https://gitee.com/kay2020/cartographer.git
git clone https://gitee.com/kay2020/cartographer_ros.git
cd ~/catkin_ws
src/cartographer/scripts/install_proto3.sh
rm -rf protobuf/
rosdep install --from-paths src --ignore-src -r -y --os=ubuntu:xenial
catkin_make_isolated --install --use-ninja

 

注意proto3版本

 

 

 

 

melodic

1
2
3
4
5
6
7
8
9
10
11
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build stow
mkdir ~/catkin_ws && cd ~/catkin_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=melodic -y
src/cartographer/scripts/install_abseil.sh
catkin_make_isolated --install --use-ninja

  

安装cartographer,找不到 "absl" 解决方法

1
2
3
4
sudo apt-get install stow
sudo chmod +x ~/catkin_ws/src/cartographer/scripts/install_abseil.sh
cd ~/catkin_ws/src/cartographer/scripts
./install_abseil.sh

  

 

 

 

 启动Cartographer SLAM节点

1
2
source ~/catkin_ws/install_isolated/setup.bash
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer

  

 

验证您的包

Cartographer ROS 提供了一个名为cartographer_rosbag_validate自动分析包中数据的工具。在尝试调整 Cartographer 以获取不正确的数据之前,运行此工具通常是一个好主意。

它得益于 Cartographer 作者的经验,可以检测出包包中常见的各种错误。例如,如果sensor_msgs/Imu检测到一个主题,该工具将确保重力矢量没有从 IMU 测量中删除,因为 Cartographer 使用重力范数来确定地面的方向。

该工具还可以提供有关如何提高数据质量的提示。例如,对于 Velodyne LIDAR,建议sensor_msgs/PointCloud2传感器发送的每个 UDP 数据包发送一条消息,而不是每圈发送一条消息。有了这个粒度,Cartographer 就能够解开由机器人运动引起的点云变形,从而实现更好的重建。

如果您已经source Cartographer ROS 环境,您可以像这样简单地运行该工具:

1
cartographer_rosbag_validate -bag_filename your_bag.bag

  

测试

1
rosbag record /imu /odom /tf /tf_static /scan -O cart3.bag

  

1
rosrun cartographer_ros cartographer_rosbag_validate -bag_filename cart3.bag

  

 

 

参考

https://google-cartographer-ros.readthedocs.io/en/latest/#building-installation

https://blog.csdn.net/weixin_44684139/article/details/104708387

https://www.cnblogs.com/gary-guo/p/10419630.html

https://blog.csdn.net/learning_tortosie/article/details/105158858

https://blog.csdn.net/weixin_43262513/article/details/88256762

 

posted @   kay880  阅读(168)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
点击右上角即可分享
微信分享提示