2018-11-05 19:22:55 +08:00
|
|
|
.. Copyright 2018 The Cartographer Authors
|
|
|
|
|
|
|
|
.. Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
.. http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
.. Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
|
|
|
|
==========================
|
|
|
|
Compiling Cartographer ROS
|
|
|
|
==========================
|
|
|
|
|
|
|
|
System Requirements
|
|
|
|
===================
|
|
|
|
|
|
|
|
The Cartographer ROS requirements are the same as `the ones from Cartographer`_.
|
|
|
|
|
|
|
|
The following `ROS distributions`_ are currently supported:
|
|
|
|
|
|
|
|
* Kinetic
|
|
|
|
* Melodic
|
2020-10-05 20:41:05 +08:00
|
|
|
* Noetic
|
2018-11-05 19:22:55 +08:00
|
|
|
|
|
|
|
.. _the ones from Cartographer: https://google-cartographer.readthedocs.io/en/latest/#system-requirements
|
|
|
|
.. _ROS distributions: http://wiki.ros.org/Distributions
|
|
|
|
|
|
|
|
Building & Installation
|
|
|
|
=======================
|
|
|
|
|
|
|
|
In order to build Cartographer ROS, we recommend using `wstool <http://wiki.ros.org/wstool>`_ and `rosdep
|
|
|
|
<http://wiki.ros.org/rosdep>`_. For faster builds, we also recommend using
|
|
|
|
`Ninja <https://ninja-build.org>`_.
|
|
|
|
|
2020-10-05 20:41:05 +08:00
|
|
|
On Ubuntu Focal with ROS Noetic use these commands to install the above tools:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y python3-wstool python3-rosdep ninja-build
|
|
|
|
|
|
|
|
On older distributions:
|
|
|
|
|
2018-11-05 19:22:55 +08:00
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y python-wstool python-rosdep ninja-build
|
|
|
|
|
2020-10-05 20:41:05 +08:00
|
|
|
After the tools are installed, create a new cartographer_ros workspace in 'catkin_ws'.
|
2018-11-05 19:22:55 +08:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
mkdir catkin_ws
|
|
|
|
cd catkin_ws
|
|
|
|
wstool init src
|
2020-06-24 16:55:03 +08:00
|
|
|
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
|
2018-11-05 19:22:55 +08:00
|
|
|
wstool update -t src
|
|
|
|
|
|
|
|
Install cartographer_ros' dependencies (proto3 and deb packages).
|
|
|
|
The command 'sudo rosdep init' will print an error if you have already executed it since installing ROS. This error can be ignored.
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
src/cartographer/scripts/install_proto3.sh
|
|
|
|
sudo rosdep init
|
|
|
|
rosdep update
|
|
|
|
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
|
|
|
|
|
2019-04-17 20:23:38 +08:00
|
|
|
If you build cartographer from master. Change/remove the version in the cartographer_ros.rosinstall.
|
|
|
|
|
|
|
|
Additionally, uninstall the ros abseil-cpp using
|
|
|
|
|
|
|
|
.. code-block:: bash
|
2020-10-13 21:00:12 +08:00
|
|
|
|
2019-04-17 20:23:38 +08:00
|
|
|
sudo apt-get remove ros-${ROS_DISTRO}-abseil-cpp
|
|
|
|
|
2018-11-05 19:22:55 +08:00
|
|
|
Build and install.
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
catkin_make_isolated --install --use-ninja
|