Derek
Derek A site dedicated interesting things like Machine Learning and Mechatronics

Building Autoware

Building Autoware

ADE which is the docker interface for Autoware is still in the early development stages so there are couple issues with the docker image used for arm64 based computers. For NVIDIA embedded computers like the Jetson TX2, most of the graphical display for ROS2 is broken due to the nature of the setup. Also, there are issues linking the build to the correct Tensorflow/TensorRT build (I am a bit surprised since Autoware is expected to work out of the box for Xavier AGX). Therefore, Autoware will run must more efficiently if you build it from source. There were numerous issues before I could build from source so I hope this write-up will help solve the same problems for you that I came across.

This particular tutorial teaches how to build Autoware on a Jetson TX2 (with the latest Jetpack 4.4). This tutorial should be applicable to other arm based Nvidia products like the Xavier and Drive units (however, I cannot confirm this since I do not own one. I would not mind testing and deploying Autoware if someone is willing to send me one).

Solution

To build Autoware on a Jetson TX2, there are multiple tasks that need to be performed.

  1. Install ROS2 (there’s a couple more steps than the typical installation)

  2. Fix some weird OpenGL issue by linking a specific file

  3. Clone Autoware

  4. Update the ROS packages with rosdep and build

Installing ROS2

Luckily there are Debian packages that can be used on the TX2. Most of the instructions to install ROS2 can be found here. However, there are a couple of important packages that are left out since they do not live in the standard ROS2 core (such as rosdep and colon). To get these, you have to install them separately.

  1. Adding the GPG key and adding the ROS2 repo to apt
    1
    2
    3
    
    sudo apt update && sudo apt install curl gnupg2 lsb-release
    curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
    sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'
    
  2. Update your apt and install
    1
    2
    
    sudo apt update
    sudo apt install ros-dashing-desktop
    
  3. Install the necessary libraries and DDS
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    
    sudo apt update && sudo apt install -y \
    build-essential \
    cmake \
    git \
    python3-colcon-common-extensions \
    python3-pip \
    python-rosdep \
    python3-vcstool \
    wget
    # install Fast-RTPS dependencies
    sudo apt install --no-install-recommends -y \
    libasio-dev \
    libtinyxml2-dev
    # install Cyclone DDS dependencies
    sudo apt install --no-install-recommends -y \
    libcunit1-dev
    
  4. ALWAYS ALWAYS ALWAYS source the ROS2 bash setup before you do anything ROS2 related
    1
    
     source /opt/ros/dashing/setup.bash
    
  5. Initialize rosdep

    1
    
    rosdep init
    

Fix some weird OpenGL issue by linking a specific file

For some reason the NVIDIA drivers on the default Jetpack does not play well with ROS2. To solve this, link the make file with a different target name. Rename the libGL .so file as shown below:

1
2
cd /usr/lib/aarch64-linux-gnu/
sudo ln -sf libGL.so.1.0.0 libGL.so

Clone the repo

  1. Go to your home directory
    1
    
    cd 
    
  2. Clone the repo
    1
    2
    
    git clone git@gitlab.com:autowarefoundation/autoware.auto/AutowareAuto.git 
    # This will be saved in ~/AutowareAuto
    

Update the ROS packages with rosdep and build

  1. Navigate to Autoware
    1
    
    cd ~/AutowareAuto
    
  2. Update your ROS packages with specifying the distro used
    1
    2
    
    rosdep update --rosdistro dashing
    rosdep install -y --from-paths src --ignore-src --rosdistro dashing
    
  3. Build
    1
    2
    
    colcon build
    #You will get some WARNINGS but should build without any ERRORS
    

Discrepancies with ADE

There are some file difference if you are following the Autoware course since the docker image in ADE mounts a couple of important files in the /opt/ folder. One of the most important ones is the Autoware bash source which is located here:

1
source AutowareAuto/install/setup.bash