Hood NUC Melih ROS2 TB3 Install

From wikidb
Jump to: navigation, search

Context

January 18, 2020

ROS 2 on Turtlebot 3 takes place here. Navigation will be removed from the install. I suspect so that the we will be working with the a current release of the Intel Navigation 2 stack.

Reference

See Melih's tutorial section "ROS 2 Turtlebot 3 Installation"

ROS 2 Turtlebot 3 Installation

Install Cartographer dependencies

The following was already installed previously.

 $ sudo apt install -y \
     google-mock \
     libceres-dev \
     liblua5.3-dev \
     libboost-dev \
     libboost-iostreams-dev \
     libprotobuf-dev \
     protobuf-compiler \
     libcairo2-dev \
     libpcl-dev \
     python3-sphinx

See Hood ROS2 Melih Cartography Dependencies Log

Install Navigation2 dependencies

The following was already installed previously as well.

 $ sudo apt install -y \
     libsdl-image1.2 \
     libsdl-image1.2-dev \
     libsdl1.2debian \
     libsdl1.2-dev

See Hood ROS2 Melih Navigation2 Dependencies Log

Create a Workspace for TB3

 eepp@hood:navigation2_ws$ cd ~/ros2_all_ws

 eepp@hood:ros2_all_ws$ mkdir turtlebot3_ws
 
 eepp@hood:ros2_all_ws$ cd turtlebot3_ws

 eepp@hood:turtlebot3_ws$ mkdir src

Clone all the up to date repositories

 eepp@hood:turtlebot3_ws$ wget https://raw.githubusercontent.com/ROBOTIS-GIT/turtlebot3/ros2/turtlebot3.repos
     --2020-01-18 10:33:00--  https://raw.githubusercontent.com/ROBOTIS-GIT/turtlebot3/ros2/turtlebot3.repos
     Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.52.133
     Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.52.133|:443... connected.
     HTTP request sent, awaiting response... 200 OK
     Length: 620 [text/plain]
     Saving to: ‘turtlebot3.repos’

     turtlebot3.repos    100%[===================>]     620  --.-KB/s    in 0s      

     2020-01-18 10:33:00 (32.7 MB/s) - ‘turtlebot3.repos’ saved [620/620]

 eepp@hood:turtlebot3_ws$ vcs import src < turtlebot3.repos
     .....
     === src/turtlebot3/turtlebot3 (git) ===
     Cloning into '.'...
     Switched to a new branch 'ros2'
     Branch 'ros2' set up to track remote branch 'ros2' from 'origin'.
     === src/turtlebot3/turtlebot3_msgs (git) ===
     Cloning into '.'...
     Switched to a new branch 'ros2'
     Branch 'ros2' set up to track remote branch 'ros2' from 'origin'.
     === src/turtlebot3/turtlebot3_simulations (git) ===
     Cloning into '.'...
     Switched to a new branch 'ros2'
     Branch 'ros2' set up to track remote branch 'ros2' from 'origin'.
     === src/utils/DynamixelSDK (git) ===
     Cloning into '.'...
     Switched to a new branch 'ros2'
     Branch 'ros2' set up to track remote branch 'ros2' from 'origin'.
     === src/utils/hls_lfcd_lds_driver (git) ===
     Cloning into '.'...
     Switched to a new branch 'ros2'
     Branch 'ros2' set up to track remote branch 'ros2' from 'origin'.

Remove Navigation Stack

 eepp@hood:turtlebot3_ws$ cd ~/ros2_all_ws/turtlebot3_ws/src

 eepp@hood:src$ ls
     turtlebot3  utils

 eepp@hood:src$ sudo rm -r navigation2
     rm: cannot remove 'navigation2': No such file or directory

 eepp@hood:src$ cd ~/ros2_all_ws/turtlebot3_ws

Not sure why this happened but it made sense at the time.

Build the Package

Source the previous built packages first

 eepp@hood:turtlebot3_ws$ source ~/ros2_all_ws/ros2_ws/install/setup.bash
     ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
     ROS_DISTRO was set to 'dashing' before. Please make sure that the environment does not mix paths from different distributions.

 eepp@hood:turtlebot3_ws$ source ~/ros2_all_ws/navigation2_ws/install/setup.bash
     ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
     ROS_DISTRO was set to 'dashing' before. Please make sure that the environment does not mix paths from different distributions.

 eepp@hood:turtlebot3_ws$ source ~/ros2_all_ws/navstack_dependencies_ws/install/setup.bash
     ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
     ROS_DISTRO was set to 'dashing' before. Please make sure that the environment does not mix paths from different distributions.

Now do the build

 eepp@hood:turtlebot3_ws$ colcon build --symlink-install
     Starting >>> turtlebot3_msgs
     Starting >>> turtlebot3_description
     Starting >>> dynamixel_sdk
     Starting >>> hls_lfcd_lds_driver
     Finished <<< turtlebot3_description [7.35s]                          
     Starting >>> turtlebot3_cartographer
     Finished <<< dynamixel_sdk [9.06s]                                   
     Starting >>> turtlebot3_navigation2
     Finished <<< turtlebot3_cartographer [6.49s]                              
     Starting >>> turtlebot3_teleop
     Finished <<< turtlebot3_teleop [6.22s]                                     
     Starting >>> turtlebot3_gazebo
     Finished <<< turtlebot3_navigation2 [11.2s]                                
     Finished <<< hls_lfcd_lds_driver [20.7s]                                   
     Finished <<< turtlebot3_gazebo [8.06s]                                     
     Finished <<< turtlebot3_msgs [35.3s]                          
     Starting >>> turtlebot3_node
     Starting >>> turtlebot3_fake_node
     finished <<< turtlebot3_fake_node [23.2s]                                  
     Starting >>> turtlebot3_simulations
     Finished <<< turtlebot3_simulations [5.32s]                                    
     Finished <<< turtlebot3_node [35.4s]                                
     Starting >>> turtlebot3_bringup
     Finished <<< turtlebot3_bringup [3.08s]                          
     Starting >>> turtlebot3
     Finished <<< turtlebot3 [3.01s]                          

     Summary: 13 packages finished [1min 17s]