index.rst 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. .. Copyright 2016 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. Cartographer ROS for TurtleBots
  13. ===============================
  14. .. toctree::
  15. :maxdepth: 2
  16. :hidden:
  17. `Cartographer`_ is a system that provides real-time simultaneous localization
  18. and mapping (`SLAM`_) in 2D and 3D across multiple platforms and sensor
  19. configurations. This repository provides Cartographer SLAM for `TurtleBots`_
  20. via `Cartographer ROS`_.
  21. .. _Cartographer: https://github.com/googlecartographer/cartographer
  22. .. _Cartographer ROS: https://github.com/googlecartographer/cartographer_ros
  23. .. _SLAM: https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping
  24. .. _TurtleBots: http://www.turtlebot.com/
  25. Building & Installation
  26. =======================
  27. Installation has been tested on Ubuntu 14.04 (Trusty) with ROS Indigo, but may
  28. also work on Ubuntu 16.04 (Xenial) with ROS Kinetic. We recommend using
  29. `wstool <http://wiki.ros.org/wstool>`_ and
  30. `rosdep <http://wiki.ros.org/rosdep>`_. For faster builds, we also recommend
  31. using `Ninja <https://ninja-build.org>`_.
  32. .. code-block:: bash
  33. # Install wstool and rosdep.
  34. sudo apt-get update
  35. sudo apt-get install -y python-wstool python-rosdep ninja-build
  36. # Create a new workspace in 'catkin_ws'.
  37. mkdir catkin_ws
  38. cd catkin_ws
  39. wstool init src
  40. # Merge the cartographer_turtlebot.rosinstall file and fetch code for dependencies.
  41. wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_turtlebot/master/cartographer_turtlebot.rosinstall
  42. wstool update -t src
  43. # Install deb dependencies.
  44. # The command 'sudo rosdep init' will print an error if you have already
  45. # executed it since installing ROS. This error can be ignored.
  46. sudo rosdep init
  47. rosdep update
  48. rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
  49. # Build and install.
  50. catkin_make_isolated --install --use-ninja
  51. source install_isolated/setup.bash
  52. Running the demo
  53. ================
  54. Now that Cartographer, Cartographer ROS, and Cartographer ROS's TurtleBot
  55. integration are installed, download the example bag to a known location, in
  56. this case ``~/Downloads``, and use ``roslaunch`` to bring up the demo:
  57. .. code-block:: bash
  58. # Download the example bag.
  59. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/turtlebot/cartographer_turtlebot_demo.bag
  60. # Launch the 2D LIDAR demo.
  61. roslaunch cartographer_turtlebot demo_lidar_2d.launch bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag
  62. # Launch the 2D depth camera demo.
  63. roslaunch cartographer_turtlebot demo_depth_camera_2d.launch bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag
  64. # Launch the 3D depth camera demo.
  65. roslaunch cartographer_turtlebot demo_depth_camera_3d.launch bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag
  66. The launch files will bring up ``roscore`` and ``rviz`` automatically.