Autoware.Auto
LGSVL simulator

LGSVL simulator: running the LGSVL simulator alongside Autoware.Auto

LGSVL is a Unity-based multi-robot simulator for autonomous vehicle developers. It provides a simulated world to

  • create sensor inputs to Autoware.Auto,
  • allow the user to manually steer the ego vehicle similar to a computer game,
  • place other moving traffic participants in a scene.

For more information about the simulator, see https://www.lgsvlsimulator.com/docs/.

Requirements

The following guide assumes that the LGSVL simulator will be run from inside an ADE container, although it is not strictly required.

Using the simulator

Using the simulator involves the following steps:

  1. Launch it
  2. Choose or create a simulation
  3. Bridge the simulator with Autoware.Auto
  4. Start the simulation

This section outlines these steps.

Launching the simulator

Install ADE as described in the installation section:

Start ADE with the LGSVL volume:

$ cd ~/adehome/AutowareAuto
$ ade --rc .aderc-lgsvl start --update --enter

Pick a different .aderc-*-lgsvl file to manually choose a ROS version.

To start the LGSVL simulator, in the same terminal window:

ade$ /opt/lgsvl/simulator

Now start your favorite browser on the host system (outside of ADE!) and go to http://127.0.0.1:8080 where simulations can be configured.

Note
When running LGSVL Simulator in a Docker container, the "Open Browser..." button in the simulator window does not work.
When running LGSVL Simulator for the first time, you may be asked to log into https://account.lgsvlsimulator.com/. If you have an account, log in. If you do not have an account, create one, then log in.

Troubleshooting

In case the simulator window opens up with a black screen and the application immediately terminates, remove conflicting graphics drivers from ADE with

ade$ sudo apt remove mesa-vulkan-drivers

and launch the simulator again.

Creating a simulation

Creating a simulation configuration takes only a few clicks in the browser. The following steps assume that the launch was successful and illustrate the configuration process with the setup for the Autonomous Valet Parking Demonstration.

Choosing a map

The goal is to create a map configuration for the AutonomouStuff parking lot. If that map is already available on the first launch of the simulation, nothings needs to be done.

Else follow the LGSVL instructions, click the Add new button and enter a name (e.g. AutonomouStuff parking lot) and the link to the asset bundle from this site containing the map data:

https://assets.lgsvlsimulator.com/ec057870762b5a967a451c93444b67d0b64e9656/environment_AutonomouStuff

Once submitted, this will download the map automatically.

Choosing a map

Configuring a vehicle

The goal is to create a vehicle configuration for the AutonomouStuff parking lot.

Follow the LGSVL instructions, to configure the Lexus model: click the vehicles tab, then Add new and enter Lexus2016RXHybrid as name and

https://assets.lgsvlsimulator.com/ea5e32fe566065c6d1bbf1f0728d6654c94e375d/vehicle_AWFLexus2016RXHybrid

as Vehicle URL.

Adding a vehicle

Once submitted, click on the wrench icon for the Lexus vehicle and

  • Change the bridge type to Ros2NativeBridge
  • In the Sensors box, copy and paste the content of lgsvl-sensors.json located at the root of the Autoware.Auto repository to tell LGSVL about sensor positions and where to communicate information to the Autoware.Auto stack.
Configuring bridge and sensors

The Ros2NativeBridge is a special bridge type which does not require a websocket-based bridge. When a simulation is started, the topics should be published in ROS 2 automatically.

The above steps are a modified version of the LGSVL documentation

Choosing/creating a simulation

Choose Simulations on the left to see the simulations screen. The LGSVL simulator lets you store and reuse multiple simulation configurations. To use an existing simulation, select the desired simulation and press the play button in the bottom right corner of the screen. The simulator should now start in the LGSVL window.

To create a new simulation, follow the below steps:

  • Switch to the Simulations tab and click the Add new button.
  • Enter a name and switch to the Map & Vehicles tab.
  • Select the Lexus2016RXHybrid from the drop-down menu.
  • Enter 127.0.0.1:9090 in the Ros2NativeBridge connction box.
  • No changes to the Traffic or Weather tab are needed but one can play around here.
  • Click submit.
Configuring the simulation
Configuring the simulation map and vehicle

Starting the simulation

Once the simulation has been created, select it by clicking on its white box first, then run it by clicking the play button.

Starting the simulation

The Lexus should appear in a 3D rendering in the LGSVL Simulator window (not in the browser).

The next step is to control the Lexus and to drive around. Press F1 to see a list of shortcuts and press the cookie button in bottom left corner for more UI controls.

The essential commands are to use the arrow keys to steer and accelerate, and the Page Up and Page Down keys to switch between forward and reverse driving.

Congratulations if everything is working up to this point. The setup of LGSVL is completed.

Controlling the Lexus

Bridging with Autoware.Auto

LGSVL uses conventions which are not directly aligned with ROS 2 conventions. The full list of behaviors the lgsvl_interface implements is:

  1. Converts control inputs with CCW positive rotations to the CCW negative inputs the LGSVL simulator expects
  2. Provides a mapping from VehicleControlCommand to the RawControlCommand LGSVL expects via parametrizable 1D lookup tables

To run the lgsvl_interface manually, enter the following in a new terminal window:

Dashing:

$ ade enter
ade$ source /opt/AutowareAuto/setup.bash
ade$ ros2 run lgsvl_interface lgsvl_interface_exe __params:=/opt/AutowareAuto/share/lgsvl_interface/param/lgsvl.param.yaml

Foxy:

$ ade enter
ade$ source /opt/AutowareAuto/setup.bash
ade$ ros2 run lgsvl_interface lgsvl_interface_exe --ros-args --params-file /opt/AutowareAuto/share/lgsvl_interface/param/lgsvl.param.yaml

Launch scripts are also provided for convenience. For example for a joystick control demo, run the following in a new terminal window:

$ ade enter
ade$ source /opt/AutowareAuto/setup.bash
ade$ ros2 launch joystick_vehicle_interface_nodes lgsvl_joystick.launch.py

For an example of using VehicleControlCommand with LGSVL, run the following demo in a new terminal window:

$ ade enter
ade$ source /opt/AutowareAuto/setup.bash
ade$ ros2 launch lgsvl_interface lgsvl_vehicle_control_command.launch.py