Autoware.Auto with LGSVL Simulator

Table of Contents

Overview top#

This guide describes setting up and using Autoware.Auto with the LGSVL 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

Installing 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.

Installing Nvidia Docker top#

  • Before installing nvidia-docker make sure that you have an appropriate Nvidia driver installed. To test if 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 390.87                 Driver Version: 390.87                    |
    | 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   147MiB |
    |    0     17936      G   ...-token=5299D28BAAD9F3087B25687A764851BB   103MiB |
  • Install nvidia docker.

    Note: For docker 19.03 and newer nvidia GPUs are natively supported as devices in docker runtime, and nvidia-docker2 is deprecated, however, because uses the --runtime nvidia argument nvidia-docker2 will need to be installed even for newer docker versions.

Installing top#

Simulator installation top#

  • Download and extract the latest simulator release
  • (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 ROS2 dashing top#

Install the ROS2 Web Bridge top#

Clone the ROS2 web bridge
cd ~/adehome/AutowareAuto
ade start -- --net=host --privileged # to allow connect to rosbridge
ade enter
git clone -b 0.2.7
Install nodejs v10
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs
cd ros2-web-bridge
npm install    # If node.js packages are not installed, run this.

Run Simulator alongside Autoware.Auto top#

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

  • Start the Autoware.Auto containers:
cd ~/adehome/AutowareAuto
ade start -- --net=host --privileged # to allow connect to rosbridge
  • Enter the container and start rviz2:
ade enter
cd ~/AutowareAuto
colcon build    # If you want to use autoware_auto_msgs, ros2-web-bridge needs compiled them.
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64/
source ~/AutowareAuto/install/local_setup.bash
rviz2 -d /home/"${USER}"/AutowareAuto/install/autoware_auto_examples/share/autoware_auto_examples/rviz2/autoware.rviz
  • Start the LGSVL Simulator by launching the executable and click on the button to open the web UI.

  • In the Vehicles tab look for Lexus2016RXHybrid. If not available download it from here and follow these instructions to add it.

    • Click on the wrench icon for the Lexus vehicle:
    • Change the bridge type to ROS2
    • Use the following JSON configuration Autoware Auto JSON Example
  • Switch to the Simulations tab and click the Add new button:

    • Enter a name and switch to the Map & Vehicles tab
    • 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. In the bridge connection box to the right enter the bridge address (default: localhost:9090)
    • Click submit Select the simulation and press the play button in the bottom right corner of the screen
  • Launch ROS2 web bridge in a new terminal:

NOTE Node.js will need to be reinstalled in the container every time it is started

ade enter      # ros2 web bridge should be run in ade environment.
cd ros2-web-bridge
source ~/AutowareAuto/install/local_setup.bash
node bin/rosbridge.js

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 is set to velodyne_front and that a PointCloud2 message is added which listens on the /points_raw topic.

Copyright (c) 2019 LG Electronics, Inc.

This software contains code licensed as described in LICENSE.