【cartographer_ros】一 : ros系统下的快速安装

Cartographer是一个跨多个平台和传感器配置提供 2D 和 3D实时同步定位和映射 ( SLAM ) 的系统。


使用Cartographer有Ros集成环境和无Ros环境,对于新手快速入门,推荐使用ROS集成。
下面介绍在Ros集成环境下快速安装Cartographer:

推荐教程:
官方:https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html#building-installation
非官方:https://blog.csdn.net/qq_26482237/article/details/92676267

以下是个人安装流程,简化优化了相关步骤:

1:安装依赖

sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build

2:创建工作区

cd catkin_ws
wstool init src

3:下载使用cartographer_ros安装脚本

wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall

下载完成之后修改脚本中ceres-solver的下载地址url:

gedit src/.rosinstall

https://ceres-solver.googlesource.com/ceres-solver.git → https://github.com/ceres-solver/ceres-solver.git
能翻墙可以不修改
git下载速度缓慢可以将使用git镜像:
github.com → github.com.cnpmjs.org

 保存退出

wstool update -t src

等待下载完成

4:安装其他库
在工作区安装proto:

src/cartographer/scripts/install_proto3.sh

安装ros

rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y

kinetic根据自己对应ROS版本相应替换

catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash

source ~/catkin_ws/install_isolated/setup.bash
可以将上面命令放到bashrc文件中,以后运行就不用反复输入了

等待编译完成,即完成全部安装流程

【完】

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
### 回答1: cartographer_ros是一个用于SLAM(Simultaneous Localization and Mapping)的开源软件包,可以在ROS(Robot Operating System)中使用。安装cartographer_ros需要以下步骤: 1. 安装ROS:在Ubuntu系统中,可以使用apt-get命令安装ROS。具体安装方法可以参考ROS官方网站的教程。 2. 安装cartographer_ros:可以使用apt-get命令安装cartographer_ros。具体命令如下: ``` sudo apt-get install ros-<distro>-cartographer-ros ``` 其中,`<distro>`是ROS的发行版名称,例如`melodic`或`noetic`。 3. 配置cartographer_ros:需要配置cartographer_ros的参数文件,以适应不同的机器人和环境。可以参考cartographer_ros官方文档中的说明进行配置。 4. 运行cartographer_ros:可以使用ROS的launch文件来启动cartographer_ros。具体命令如下: ``` roslaunch cartographer_ros <launch_file>.launch ``` 其中,`<launch_file>`是启动文件的名称,例如`demo_backpack_2d.launch`或`demo_revo_lds.launch`。 以上就是安装cartographer_ros的基本步骤。需要注意的是,安装和配置cartographer_ros需要一定的ROS和SLAM知识,建议在使用前先学习相关知识。 ### 回答2: Cartographer_ros是一种针对机器人定位、车辆导航、地图绘制的软件,它基于Google Cartographerros系统进行开发。这种软件的安装可以方便的实现地图制作与定位服务,从而实现机器人的移动与导航。 一、使用Cartographer_ros前需要的系统设置和准备 Cartographer_ros适用于Ubuntu 14.04/16.04 LTS版本操作系统,并且需要安装一些相应的软件包和工具,例如cmake, pkg-config和protobuf。安装方法如下: 1、cmake的安装 sudo apt-get install cmake 2、pkg-config的安装 sudo apt-get install pkg-config 3、protobuf的安装 sudo apt-get install protobuf-compiler 如果以上软件包和工具已经安装完毕,可以从Git托管库中下载和安装Cartographer_ros软件包。 二、在Ubuntu中使用Cartographer_ros Cartographer_ros可以通过下载和安装软件包来使用。以下是在Ubuntu中使用Cartographer_ros的具体步骤: 1、首先,需要在Ubuntu终端中安装Cartographer_ros的依赖项。具体方法如下: sudo apt-get install python-wstool python-rosdep ninja-build 2、创建一个新的catkin工作目录,并将Cartographer_ros的源代码下载到~/catkin_ws/src目录下。执行以下命令: mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src wget https://github.com/cartographer-project/cartographer_ros/archive/master.zip unzip master.zip rm master.zip 3、运行源代码的更新和依赖项安装命令: # Run this once to fetch the code into your workspace. wstool init -j8 src cartographer_ros_https://github.com/cartographer-project/cartographer_ros.rosinstall # wstool can also install a specific version of cartographer_ros. wstool merge -t src cartographer_ros_https://github.com/cartographer-project/cartographer_ros.rosinstall # Use cartographer_ros_branch_name if you want switch to a specific release. wstool update -t src # Install deb dependencies. rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y 4、执行以下命令编译Cartographer_ros: # Build and install. catkin_make_isolated --install --use-ninja source install_isolated/setup.bash 5、执行以下命令启动Cartographer_rosroslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag 6、通过rviz查看Cartographer_ros的地图。 以上是Cartographer_ros安装和使用方法,需要注意的是在使用之前需要安装相应的依赖项,这样才能够正常运行地图和导航等功能。使用Cartographer_ros可以方便可靠的实现机器人的地图制作和导航等功能,大幅提高了机器人导航的效率和精度。 ### 回答3: cartographer_ros是一种在ROS中实现的开源SLAM算法,它可以使用激光雷达和深度相机将机器人的周围环境建模和定位。cartographer_ros安装包含三个部分:安装依赖项、下载和编译cartographer、下载和编译cartographer_ros。 首先,安装依赖项。cartographer_ros需要安装一些依赖项,包括glog、gflag、protobuf、ceres-solver、numpy、matplotlib等。您可以使用以下命令安装这些依赖项: ```bash sudo apt-get update sudo apt-get install -y python-wstool python-rosdep ninja-build stow sudo rosdep init rosdep update cd ~/catkin_ws rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y ``` 注意:在上述命令中,~/catkin_ws是您的ROS workspace路径,${ROS_DISTRO}是您使用的ROS发行版名称(如kinetic、melodic等)。 接下来,下载和编译cartographer。您可以使用以下命令在src目录下克隆cartographer的源代码,并在catkin_ws目录下进行编译: ```bash cd ~/catkin_ws/src git clone https://github.com/googlecartographer/cartographer.git cd cartographer git checkout -b v1.0.0 git submodule update --init --recursive cd .. catkin_make_isolated --install --use-ninja ``` 注意:在上述命令中,v1.0.0是cartographer的版本号,您可以根据需要更改。此外,如果您使用的是ROS kinetic或更早的版本,则应使用catkin_make而不是catkin_make_isolated。 最后,下载和编译cartographer_ros。您可以使用以下命令在src目录下克隆cartographer_ros的源代码,并在catkin_ws目录下进行编译: ```bash cd ~/catkin_ws/src git clone https://github.com/googlecartographer/cartographer_ros.git cd .. catkin_make_isolated --install --use-ninja ``` 安装完成后,您可以在ROS中使用cartographer_ros来建立地图、定位机器人和规划路径。具体使用方法可以参考cartographer_ros的文档和教程。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

CloudFlame

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

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

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

打赏作者

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

抵扣说明:

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

余额充值