Autoware.Auto with SVL Simulator

Table of Contents

Overview top#

This guide describes setting up and using Autoware.Auto with the SVL Simulator. As Autoware.Auto is still under-development, full self-driving is not yet possible. This guide will focus on running individual modules which have been implemented.

Setup top#

Requirements top#

  • Linux operating system
  • NVIDIA graphics card

Install Docker CE top#

To install Docker CE please refer to theĀ official documentation. We also suggest following through with theĀ post installation steps to run docker as a non-root user.

Install NVIDIA Container Toolkit top#

Before installing the NVIDIA Container Toolkit, make sure that you have the appropriate NVIDIA drivers installed. To test if the NVIDIA drivers are properly installed, enter nvidia-smi in a terminal. If the drivers are installed properly an output similar to the following should appear:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59       Driver Version: 440.59       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:65:00.0  On |                  N/A |
|  0%   59C    P5    22W / 250W |   1490MiB / 11175MiB |      4%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1187      G   /usr/lib/xorg/Xorg                           863MiB |
|    0      3816      G   /usr/bin/gnome-shell                         305MiB |
|    0      4161      G   ...-token=7171B24E50C2F2C595566F55F1E4D257    68MiB |
|    0      4480      G   ...quest-channel-token=3330599186510203656   147MiB |
|    0     17936      G   ...-token=5299D28BAAD9F3087B25687A764851BB   103MiB |
+-----------------------------------------------------------------------------+

The installation steps for the NVIDIA Container Toolkit are available from the official documentation.

Simulator installation top#

  • Download and extract the latest simulator release under the ~/adehome folder.
  • (Optional) Download the latest PythonAPI release (make sure the release version matches the simulator) and install it using pip:
cd PythonAPI
pip3 install --user .

Install Autoware.auto top#

Install ADE top#

# https://ade-cli.readthedocs.io/en/latest/install.html
cd ~/.local/bin
wget https://gitlab.com/ApexAI/ade-cli/uploads/f6c47dc34cffbe90ca197e00098bdd3f/ade+x86_64
$ mv ade+x86_64 ade
$ chmod +x ade
$ ./ade --version
4.0.0
$ ./ade update-cli
$ ./ade --version
<latest-version>
PATH=$PATH:~/.local/bin
mkdir -p ~/adehome
cd ~/adehome
touch .adehome

Download Autoware.Auto top#

Download Autoware.Auto under the ~/adehome folder.

cd ~/adehome
git clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git

Installation and Development: Setup guide guide for Autoware.auto.

Install ROS2 LGSVL Bridge top#

There are two ways of installing ros2-lgsvl-bridge:

  • Using the Package Manager
  • Building source code

1. Using the Package Manager#

# In the ade container
sudo apt update
sudo apt install ros-foxy-lgsvl-bridge

2. Building source code.#

Downloading
cd ~/adehome/AutowareAuto/src/external
git clone https://github.com/lgsvl/ros2-lgsvl-bridge.git
cd ros2-lgsvl-bridge
git pull origin foxy-devel
git checkout foxy-devel
Building

Refer to README.md in the repo.

# In the ade container
cd ~/AutowareAuto
colcon build --packages-select lgsvl_bridge --cmake-args '-DCMAKE_BUILD_TYPE=Release'
Running

Refer to README.md in the repo.

source ~/AutowareAuto/src/external/ros2-lgsvl-bridge/install/setup.bash
lgsvl_bridge

Install ROS2 LGSVL Messages top#

Downloading
mkdir -p ~/adehome/AutowareAuto/src/external/
cd ~/adehome/AutowareAuto/src/external/
git clone https://github.com/lgsvl/lgsvl_msgs.git
Building
# In the ade container
cd ~/AutowareAuto
colcon build --cmake-args '-DCMAKE_BUILD_TYPE=Release'
# You may want to build only lgsvl_msgs package with the following command.
colcon build --packages-select lgsvl_msgs --cmake-args '-DCMAKE_BUILD_TYPE=Release'
Testing
cd ~/AutowareAuto
source install/setup.bash
ros2 msg list |grep lgsvl_msgs
# If you can see the list of lgsvl_msgs, they're ready to be used.

Run Simulator alongside Autoware.Auto top#

The ROS2 web bridge allows the simulator and Autoware.auto to communicate. To test this connection we can visualize sensor data from the simulator in rviz2 (running in the Autoware.auto container).

Start the Autoware.Auto containers without NVIDIA setup:#

cd ~/adehome/AutowareAuto
source .aderc-amd64-foxy-lgsvl
ade start

Start the Autoware.Auto containers with NVIDIA setup:#

Create a aderc file which has nvidia setup:

vim  ~/adehome/AutowareAuto/.aderc-amd64-foxy-lgsvl-nvidia

.aderc-amd64-foxy-lgsvl-nvidia:

export ADE_DOCKER_RUN_ARGS="--cap-add=SYS_PTRACE --net=host --privileged --add-host ade:127.0.0.1 -e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp --runtime=nvidia -ti --rm -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
-e NVIDIA_VISIBLE_DEVICES=all \
-e NVIDIA_DRIVER_CAPABILITIES=compute,utility,display"
export ADE_GITLAB=gitlab.com
export ADE_REGISTRY=registry.gitlab.com
export ADE_DISABLE_NVIDIA_DOCKER=false
export ADE_IMAGES="
  registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/ade-foxy:master   registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/binary-foxy:master
  registry.gitlab.com/autowarefoundation/autoware.auto/ade-lgsvl/foxy:2020.06
  nvidia/cuda:11.0-base
"

Start ADE container:

cd ~/adehome/AutowareAuto
source .aderc-amd64-foxy-lgsvl-nvidia
ade start
  • Enter the container and start rviz2:
ade enter
cd ~/AutowareAuto
colcon build
source ~/AutowareAuto/install/setup.bash
rviz2 -d /home/"${USER}"/AutowareAuto/install/autoware_auto_examples/share/autoware_auto_examples/rviz2/autoware.rviz
  • Start the SVL Simulator outside ADE container by launching the executable and click on the OPEN BROWSER button to open the web UI.
$ (path\to\downloaded\simulator)/svlsimulator-linux64-2021.1/simulator
  • In the Vehicles tab under Library look for Lexus2016RXHybrid. If not available, see the Library page to add it.

    • Make sure that Autoware.Auto sensor configuration has the ROS2 bridge and all of sensors are added.
    • Click Vehicles under Library in the left side and click Lexus2016RXHybrid and click Autoware.Autoin Sensor Configurations.
    • If you can see i mark next to sensor name, click Add to Library button to add sensor plugins into library.
  • Switch to the Simulations tab and click the Add new button:

    • Enter a Simulation Name and click Next.
    • Select Random Traffic in Runtime Template.
    • Select a map from the drop down menu. If none are available follow this guide to get a map.
    • Select the Lexus2016RXHybrid from the drop down menu of Vehicle.
    • Select the Autoware.Auto in Sensor Configuration and click Next.
  • Select Autoware.Auto (Apex.AI) in Autopilot and enter the bridge address (default:localhost:9090) in Bridge IP box and click Next.

    • Click Publish.
    • Press Run Simulation button.
  • Launch ROS2 LGSVL bridge in a new terminal:

# In the ADE container
$ lgsvl_bridge

NOTE ROS2 LGSVL Bridge needs to be running.

You should now be able to see the LiDAR point cloud in rviz (see image below).

If the pointcloud is not visible make sure the Fixed Frame (under Global Options) is set to lidar_front and that a PointCloud2 message is added which listens on the /lidar_front/points_raw topic.