compilation.rst 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .. Copyright 2018 The Cartographer Authors
  2. .. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. .. http://www.apache.org/licenses/LICENSE-2.0
  6. .. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. ==========================
  12. Compiling Cartographer ROS
  13. ==========================
  14. System Requirements
  15. ===================
  16. The Cartographer ROS requirements are the same as `the ones from Cartographer`_.
  17. The following `ROS distributions`_ are currently supported:
  18. * Kinetic
  19. * Melodic
  20. * Noetic
  21. .. _the ones from Cartographer: https://google-cartographer.readthedocs.io/en/latest/#system-requirements
  22. .. _ROS distributions: http://wiki.ros.org/Distributions
  23. Building & Installation
  24. =======================
  25. In order to build Cartographer ROS, we recommend using `wstool <http://wiki.ros.org/wstool>`_ and `rosdep
  26. <http://wiki.ros.org/rosdep>`_. For faster builds, we also recommend using
  27. `Ninja <https://ninja-build.org>`_.
  28. On Ubuntu Focal with ROS Noetic use these commands to install the above tools:
  29. .. code-block:: bash
  30. sudo apt-get update
  31. sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow
  32. On older distributions:
  33. .. code-block:: bash
  34. sudo apt-get update
  35. sudo apt-get install -y python-wstool python-rosdep ninja-build stow
  36. After the tools are installed, create a new cartographer_ros workspace in 'catkin_ws'.
  37. .. code-block:: bash
  38. mkdir catkin_ws
  39. cd catkin_ws
  40. wstool init src
  41. wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
  42. wstool update -t src
  43. Now you need to install cartographer_ros' dependencies.
  44. First, we use ``rosdep`` to install the required packages.
  45. The command 'sudo rosdep init' will print an error if you have already executed it since installing ROS. This error can be ignored.
  46. .. code-block:: bash
  47. sudo rosdep init
  48. rosdep update
  49. rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
  50. # Only on Ubuntu 16 / ROS Kinetic: src/cartographer/scripts/install_proto3.sh
  51. Cartographer uses the `abseil-cpp`_ library that needs to be manually installed using this script:
  52. .. code-block:: bash
  53. src/cartographer/scripts/install_abseil.sh
  54. Due to conflicting versions you might need to uninstall the ROS abseil-cpp using
  55. .. code-block:: bash
  56. sudo apt-get remove ros-${ROS_DISTRO}-abseil-cpp
  57. Build and install.
  58. .. code-block:: bash
  59. catkin_make_isolated --install --use-ninja
  60. This builds Cartographer from the latest HEAD of the master branch.
  61. If you want a specific version, you need to change the version in the cartographer_ros.rosinstall.
  62. .. _abseil-cpp: https://abseil.io/