Cartographer系列之三——ROS中的安裝


個人能力有限,若有錯誤請批評指正!
轉載請標明出處:http://www.cnblogs.com/wenhust/

 

Cartographer ROS Integration

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations. This project provides Cartographer’s ROS integration.
官網地址:https://github.com/googlecartographer

一、安裝說明

1. System Requirements

Although Cartographer may run on other systems, it is confirmed to be working on systems that meet the following requirements:

  • 64-bit, modern CPU (e.g. 3rd generation i7)
  • 16 GB RAM
  • Ubuntu 14.04 (Trusty)
  • gcc version 4.8.4
  • ROS Indigo
2. Known Issues
  • 32-bit builds have libeigen alignment problems which cause crashes and/or memory corruptions.
3. 安裝流程主要參考Cartographer的官方安裝教程:

二、安裝流程

1. 安裝Ubuntu14.04(Trusty)

將安裝鏡像文件制作U盤鏡像,進入BIOS或WIN10下進入設置->更新和安全->恢復->高級啟動,使用U盤啟動,完成Ubuntu14.04(Trusty)的安裝。

2. 安裝ROS(indigo)

參考文件
http://wiki.ros.org/indigo/Installation/Ubuntu (英文原版)
http://wiki.ros.org/cn/indigo/Installation/Ubuntu (中文翻譯)

3. Building & Installation

We recommend using wstool and rosdep. For faster builds, we also recommend using Ninja.

# Install wstool and rosdep. sudo apt-get update sudo apt-get install -y python-wstool python-rosdep ninja-build # Create a new workspace in 'catkin_ws'. mkdir catkin_ws cd catkin_ws wstool init src # Merge the cartographer_ros.rosinstall file and fetch code for dependencies. wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall wstool update -t src

注意:
此步驟需要科學上網,解決辦法有兩個:

  • 科學上網。
    使用VPN等方式,使得可正常下載到ceres-solver。
  • 不翻牆。
    修改下載地址為https://github.com/ceres-solver/ceres-solver.git,以正常下載到相關源碼。
    cd src
    mv .rosinstall rosinstall
    點擊打開rosinstall文件,將內容替換為
    - git:
    local-name: cartographer
    uri: https://github.com/googlecartographer/cartographer.git
    - git:
    local-name: cartographer_ros
    uri: https://github.com/googlecartographer/cartographer_ros.git
    - git:
    local-name: ceres-solver
    uri: https://github.com/ceres-solver/ceres-solver.git
    然后繼續將文件名改回
    mv rosinstall .rosinstall
    cd ..

繼續下列操作:

# Install deb dependencies. rosdep init rosdep update

以上兩步如果在安裝ROS中已經完成,此處會提示已初始化,則可不必再次初始化,直接繼續下列操作:

rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y # Build and install. catkin_make_isolated --install --use-ninja source install_isolated/setup.bash

注意: 如果每次打開一個新的終端時ROS環境變量都能夠自動配置好(即添加到bash會話中),那將會方便得多:
echo "source ~/catkin_ws/install_isolated/setup.bash" >> ~/.bashrc
source ~/.bashrc
如果你只想改變當前終端下的環境變量,你可以執行命令:
source ~/catkin_ws/install_isolated/setup.bash

4. Running the demos

Now that Cartographer and Cartographer’s ROS integration are installed, download the example bags (e.g. 2D and 3D backpack collections of the Deutsches Museum) to a known location, in this case ~/Downloads, and use roslaunch to bring up the demo:

# Download the 2D backpack example bag. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag # Launch the 2D backpack demo. roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag # Download the 3D backpack example bag. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/b3-2016-04-05-14-14-00.bag # Launch the 3D backpack demo. roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag # Download the Revo LDS example bag. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/revo_lds/cartographer_paper_revo_lds.bag # Launch the Revo LDS demo. roslaunch cartographer_ros demo_revo_lds.launch bag_filename:=${HOME}/Downloads/cartographer_paper_revo_lds.bag # Download the PR2 example bag. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/pr2/2011-09-15-08-32-46.bag # Launch the PR2 demo. roslaunch cartographer_ros demo_pr2.launch bag_filename:=${HOME}/Downloads/2011-09-15-08-32-46.bag # Download the Taurob Tracker example bag. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/taurob_tracker/taurob_tracker_simulation.bag # Launch the Taurob Tracker demo. roslaunch cartographer_ros demo_taurob_tracker.launch bag_filename:=${HOME}/Downloads/taurob_tracker_simulation.bag

The launch files will bring up roscore and rviz automatically.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM