Autoware.Auto
SVL simulator

SVL simulator: running the SVL simulator alongside Autoware.Auto

SVL 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.svlsimulator.com/docs/getting-started/getting-started/.

Requirements

The following guide assumes that the SVL 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. Configure cluster (one time step)
  3. Choose or create a simulation
  4. Start the simulation

This section outlines these steps. You also need an SVL account to use the simulator, if you do not have one, create it now on https://wise.svlsimulator.com/.

Launching the simulator

Install ADE as described in the installation section:

Start ADE with the SVL volume:

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

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

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

ade$ /opt/lgsvl/simulator

Troubleshooting

In case the simulator window opens up with a black screen and the application immediately terminates, have a look at the log file at

~/.config/unity3d/LGElectronics/SVLSimulator/Player.log

One possible fix is to remove conflicting graphics drivers from ADE with

ade$ sudo apt remove mesa-vulkan-drivers

and launch the simulator again.

If point cloud data or image data is not being visualized in rviz but other data such as bounding box is visible run the following command inside ade,

ade$ sudo apt update ; sudo apt dist-upgrade

Configure the cluster

You need to make your ADE environment a valid SVL cluster in order to launch any simulations. This is a one time configuration step.

On your first simulator run there should be a window with only one button: LINK TO CLOUD. Click it and a web browser with https://wise.svlsimulator.com/ should open. You can create a new cluster there by providing a cluster name and clicking Create cluster button.

More about linking to cloud: documentation.

Creating a simulation

Creating a simulation 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.

Start your browser and go to SVL simulator web interface. You should have your account set up already, so sign in using the button on the top right of the screen.

Choosing a map

The goal is to add AutonomouStuff parking lot map to your library. If that map is already in your library then nothing needs to be done.

Adding a map to your library:

  • Go to Store -> Maps.
  • Click + button next to AutonomouStuff map (you can use search bar to filter by name).
Choosing a map

Configuring a vehicle

The goal is to add AWFLexus2016RXHybrid vehicle to your library. If this vehicle is already in your library then nothing needs to be done.

Adding a vehicle to your library:

  • Go to Store -> Vehicles.
  • Click + button next to AWFLexus2016RXHybrid vehicle (you can use search bar to filter by name).
Adding a vehicle

Adding ROS2ForUnitySVLBridge

The goal is to add native ROS2 bridge to your library. If this bridge is already in your library then nothing needs to be done:

You can also search for ROS2ForUnitySVLBridge using the search bar.

Configure vehicle sensors

Once you added vehicle to your library:

  • Go to Library -> Vehicles.
  • Click on the AWFLexus2016RXHybrid portrait. You will be forwarded to a vehicle edit page.
  • Click a button near Sensor Configurations section to modify sensor configurations.
Configuring sensors

Notice that there is already an Autoware.Auto configuration. To make sure that we are running the newest version possible, it is better to create a new one and use the most recent version of sensor configuration file:

  • Click + Create New Configuration button at the bottom of the page.
  • Set a configuration name and pick ROS2ForUnitySVLBridge as a bridge. This is a native implementation of ROS2 bridge.
  • Confirm.

In the configuration edit view:

  • Click {...} symbol near Visual Editor (preview) window.
  • Paste contents of avp-sensors.json file inside edit window. Configurator window should populate with bunch of sensors now.
  • Click Save to save configuration.
Json configuration file

That’s it. Now you have a vehicle with a valid configuration.

Choosing/creating a simulation

The SVL simulator lets you store and reuse multiple simulation configurations. To use an existing simulation, navigate to Simulations tab and press the "Run Simulation" button for desired instance. The simulator should now start in the SVL window.

To create a new simulation, follow the below steps.

Note
There may be some AutowareAuto demos that use their own preset simulation by default, which takes advantage of the LGSVL API. This will automatically configure the simulation to the recommended settings for the demo. For this case you need to create an API Only simulation.
  • Switch to the Simulations tab and click the Add new button;
  • Enter a name, description and select a cluster. Click Next;
  • For preset simulations:

    • Select the API Only runtime template from the drop-down menu.

    or for custom simulations:

    • Select the Random Traffic runtime template from the drop-down menu;
    • Select AutonomouStuff map and AWFLexus2016RXHybrid vehicle with your sensor configuration. Click Next;
    • Select Other ROS 2 Autopilot autopilot and leave Bridge Connection with default value.
  • Click Next and then Publish.

You can visit SVL documentation for more in-depth description.

Starting the simulation

Once the simulation has been created, you can run it by clicking the Run Simulation button next to the simulation configuration widget in Simulations view.

Starting the simulation, preset simulations
Starting the simulation, custom simulations

Preset simulation

The API Ready text should appear in the SVL Simulator window (not in the browser).

API Ready simulator view

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

Custom simulation

The Lexus should appear in the SVL 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 SVL is completed.

Controlling the Lexus

Bridging with Autoware.Auto

SVL 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 SVL simulator expects
  2. Provides a mapping from VehicleControlCommand to the RawControlCommand SVL expects via parametrizable 1D lookup tables

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

$ 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

Autoware.Auto uses PointCloud2 messages with x,y,z,intensity rather than x,y,z,intensity,timestamp fields.

This node will convert points_xyzi

Run point_type_adapter to convert the messages.

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

For an example of using VehicleControlCommand with SVL, 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

Running Autoware Joystick Demo on LGSVL

To test Autoware and LGSVL installation, follow the instructions below to drive the vehicle with a joystick in LGSVL using Autoware.

Prepare a joystick. Most joysticks can be recognized by Linux under /dev/input/js0. Autoware natively supports Logitech F310 joystick, the mapping file of which can be found in joystick_vehicle_interface_nodes package.

For other joysticks, a similar mapping file needs to be created.

Stop any running ADE containers:

ade stop

Launch a new ADE container and pass the joystick device to it, assuming js0 is your joystick device. Then launch the simulator:

$ ade --rc .aderc-amd64-foxy-lgsvl start --update --enter -- --device /dev/input/js0
ade$ /opt/lgsvl/simulator

In LGSVL, create and start a simulation scenario described as above.

Finally, launch the Autoware joystick demo in a new terminal:

$ ade enter
ade$ source /opt/AutowareAuto/setup.bash
# If you are using a Logitech F310 joystick:
ade$ ros2 launch joystick_vehicle_interface_nodes lgsvl_joystick.launch.py
# OR, if you have a custom joystick mapping:
ade$ ros2 launch joystick_vehicle_interface_nodes lgsvl_joystick.launch.py joy_translator_param:=/path/to/your/joystick/config.param.yaml