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
作者:kay 出处:https://www.cnblogs.com/kay2018/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 如果文中有什么错误,欢迎指出。以免更多的人被误导。 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」