INSTALLATION INSTRUCTIONS

Robotics-Academy currently supports Linux operating system. These installation instructions have been prepared for Ubuntu Linux 18.04 (LTS). Don’t install everything listed here, just follow the directions on the Academy exercise you want to perform. For instance, not all the specific infrastructure packages are required for every exercise, and they can be large packages.

  1. Generic infrastucture
    • Required
    • ROS middleware, Gazebo simulator, JdeRobot-base, JdeRobot-assets
  2. Specific infrastructure
    • Optional, depends on the exercise
    • Some exercises require also additional software pieces such as OpenCV, MoveIt!, MavROS, PX4, VisualStates, OpenMotionPlanningLibrary, Turtlebot2, etc.
  3. JdeRobot Academy source code
    • Required
    • Academy includes templates for the exercises

Generic infrastructure

ROS Middleware

Supported release is ROS-Melodic. It can be easily installed from official Debian packages, maintained by OpenRobotics organization.

  1. Add the lastest ROS source:

     sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    
     sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
    
  2. Update the repositories
     sudo apt update
    
  3. Install the official ROS Melodic Debian package

     sudo apt install ros-melodic-desktop-full
    
  4. Environment setup
     echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
     source ~/.bashrc
    
  5. Dependencies for building packages
    sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential  
    sudo rosdep init  
    rosdep update  
    

    For more information, refer ros wiki

Gazebo simulator

Supported release is Gazebo-9. It can be easily installed from official Debian packages, maintained by OpenRobotics organization. You can safely ignore this step as Gazebo-9 will be automatically installed with ROS Melodic package (described in the previous step).

JdeRobot-base

Supported release is 6.1.0. It contains ROS drivers not included in the official ROS packages.

  1. Add the latest JdeRobot-base source

     sudo sh -c 'echo "deb [arch=amd64] http://wiki.jderobot.org/apt `lsb_release -cs` main" > /etc/apt/sources.list.d/jderobot.list'
    
  2. Get and add the public key from the JdeRobot repository

     sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 24E521A4
    
  3. Update the repositories

     sudo apt update
    
  4. Install JdeRobot-base

     sudo apt install jderobot
    
  5. Source the environment variables:

     echo "source /opt/jderobot/setup.bash" >> ~/.bashrc 
     source ~/.bashrc    
    

JdeRobot-assets

Supported release is 6.1.0 It contains Gazebo world files and configuration files required for the Academy exercises.

  1. Install jderobot-assets debian package

     sudo apt install jderobot-assets
    
  2. Install jderobot-assets ROS package

     sudo apt install ros-melodic-jderobot-assets
    
  3. Source the environment variables:

     echo "source /opt/jderobot/share/jderobot/gazebo/gazebo-setup.sh" >> ~/.bashrc
     echo "source /opt/jderobot/share/jderobot/gazebo/assets-setup.sh" >> ~/.bashrc
     source ~/.bashrc
    

Specific infrastructure

OpenCV

You can install OpenCV in several ways:

For more information, visit the official repository.

MavROS

  1. Install ROS Melodic, MAVROS and extras

     sudo apt install ros-melodic-mavros ros-melodic-mavros-extras
    

PX4

Install previous dependencies:

  1. Download and install GeographicLib

     wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
     ./install_geographiclib_datasets.sh
    
  2. Remove modemmanager

     sudo apt remove modemmanager
    
  3. Install common dependencies

     sudo apt update -y
     sudo apt install git zip qtcreator cmake \
         build-essential genromfs ninja-build exiftool -y
    
  4. Install xxd

     which xxd || sudo apt install xxd -y || sudo apt install vim-common --no-install-recommends -y
    
  5. Install required python packages

     sudo apt install python-argparse \
         python-empy python-toml python-numpy python-yaml \
         python-dev python-pip -y
     sudo -H pip install --upgrade pip
     sudo -H pip install pandas jinja2 pyserial cerberus
     sudo -H pip install pyulog
     sudo -H pip install packaging
    
  6. Install ninja

     sudo apt install ninja-build -y
    
  7. Get FastRTPS and FastCDR

     wget https://www.eprosima.com/index.php/component/ars/repository/eprosima-fast-dds/eprosima-fast-rtps-1-7-1/eprosima_fastrtps-1-7-1-linux-tar-gz -O eprosima_fastrtps-1-7-1-linux.tar.gz
     tar -xzf eprosima_fastrtps-1-7-1-linux.tar.gz eProsima_FastRTPS-1.7.1-Linux/
     tar -xzf eprosima_fastrtps-1-7-1-linux.tar.gz requiredcomponents
     tar -xzf requiredcomponents/eProsima_FastCDR-1.0.8-Linux.tar.gz
    
  8. Build FastRTPS and FastCDR

     (cd eProsima_FastCDR-1.0.8-Linux && ./configure --libdir=/usr/lib && make -j2 && sudo make install)
     (cd eProsima_FastRTPS-1.7.1-Linux && ./configure --libdir=/usr/lib && make -j2 && sudo make install)
     rm -rf requiredcomponents eprosima_fastrtps-1-7-1-linux.tar.gz
    
  9. Install catkin tools

     sudo apt install python-catkin-tools
    
  10. Set up catkin workspace

    mkdir -p catkin_ws/src
    cd catkin_ws/src
    git clone https://github.com/PX4/Firmware.git
    cd Firmware
    git submodule update --init --recursive
    cd ..
    ln -s Firmware/Tools/sitl_gazebo mavlink_sitl_gazebo
    cd ..
    
  11. Update ROS dependencies

    rosdep update
    rosdep check --from-paths . --ignore-src --rosdistro melodic
    rosdep install --from-paths . --ignore-src --rosdistro melodic -y
    
  12. Build catkin (make sure to be at /catkin_ws)

    catkin build
    
  13. Export environment variables

    echo 'source '$PWD'/devel/setup.bash' >> ~/.bashrc
    echo 'export GAZEBO_RESOURCE_PATH=${GAZEBO_RESOURCE_PATH}:/usr/share/gazebo-9' >> ~/.bashrc
    echo 'export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/opt/ros/melodic/share/jderobot_assets/models' >> ~/.bashrc
    
    source ~/.bashrc
    

Real Turtlebot2 on ROS Melodic

  1. Prerequisites
    • ROS Melodic on Ubuntu 18
    • Turtlebot2
  2. Build Turtlebot2 Workspace

Firstly, cd to your catkin workspace.

If you don’t have one, cd to somewhere you want to create it, and then run the following commands to create one

mkdir -p src
catkin_make

Now run the following command (inside the root of catkin workspace) to build up running environment for Turtlebot2

curl -sLf https://raw.githubusercontent.com/gaunthan/Turtlebot2-On-Melodic/master/install_basic.sh | bash
catkin_make
  1. Bring Up Turtlebot2 Now connect a turtlebot2 to the computer. After that, run this command to bring up the Turtlebot2
    source ./devel/setup.bash
    roslaunch turtlebot_bringup minimal.launch
    

If nothing wrong, you will hear the Turtlebot2 give out a reminder.

  1. Test Turtlebot2 If you want to use keyboard to control it, just run the following command
    source ./devel/setup.bash
    roslaunch turtlebot_teleop keyboard_teleop.launch
    

And it will output something like this

ROS_MASTER_URI=http://localhost:11311

process[turtlebot_teleop_keyboard-1]: started with pid [23757]

Control Your Turtlebot!
---------------------------
Moving around:
   u    i    o
   j    k    l
   m    ,    .

q/z : increase/decrease max speeds by 10%
w/x : increase/decrease only linear speed by 10%
e/c : increase/decrease only angular speed by 10%
space key, k : force stop
anything else : stop smoothly

CTRL-C to quit

currently:	speed 0.2	turn 1 

Now you should be able to use keyboard to control your Turtlebot2.

  1. Asus Xtion

Install dependencies:

sudo apt-get install ros-melodic-rgbd-launch ros-melodic-openni2-camera ros-melodic-openni2-launch
sudo apt-get install ros-melodic-rqt ros-melodic-rqt-common-plugins ros-melodic-rqt-robot-plugins

Run these commands on three different terminals to test it:

roscore
roslaunch openni2_launch openni2.launch
rqt

In this last application, rqt, go to Plugins -> Visualization -> Image view -> depth/image_raw to view the camera depth raw data.

  1. RPLidar

Just test it! Run these commands on two different terminals:

roscore
roslaunch rplidar_ros view_rplidar.launch 

MoveIt!

Academy source code

Once you have generic and specific infrastructure installed in your system, you can download and install the JdeRobot Academy software.

  1. Clone the Academy software repository

     git clone https://github.com/JdeRobot/Academy.git