Driving Example

Driving Example Documentation

Overview

This guide explains how to use and customize the driving simulation example in SightLab. The example is located in the ExampleScripts-Driving folder.

Driving_GUI.py uses the GUI version. Pressing spacebar will start the experiment or proceed to the next trial. Trial 1 shows a daytime cycle, while Trial 2 shows a nighttime cycle with the car headlights toggled on. Trial 3 goes back to the Day Cycle. This can all be modified (see below). 

Driving_example.py uses only code, but has similar functionality to Driving_GUI

Driving_GUI_Traffic.py shows adding some cross traffic flow. Can modify the code to adjust speed and number of additional cars. Uses collision detection to check whether your vehicle collides with any others. If so, this ends the trial. 

Controls

Desktop

HMD (Head-Mounted Display)

SteamVR/Vive Controllers

Customization

Changing the Environment

Changing the Vehicle

Modify the DrivingConfig file to select a different vehicle. Place your new vehicle in the "Resources" or some other sub folder and reference the path to that model in the DrivingConfig file. 


Alternatively, for the non-GUI version (Driving_example), modify the DrivingConfig file to select a different environment, vehicle or audio file

ENVIRONMENT_MODEL = "Resources/environments/street_scene.osgb"

CAR_MODEL = 'sightlab_resources/objects/car.osgb'

ENGINE_AUDIO = 'Resources/Engine.mp3'


Changing View Position in Car


if sightlab.getConfig() in ['Driving Desktop']:

transportNode2.setPosition([0.25, 0.65, 0.35])

elif sightlab.getConfig() in ['Driving SteamVR']:

transportNode2.setPosition([0.188, 1.315, 0.8676])

elif sightlab.getConfig() in ['Driving Vive']:

transportNode2.setPosition([-0.0360, 0.7195, 0.5641])

elif sightlab.getConfig() in ['Driving Meta']:

transportNode2.setPosition([0.2337, 0.641, 0.3140])

Customizing Controls

Note: You may need to set permissions on the file to edit the vizconnect.

Using Alternative Input Devices

You can connect various joysticks, such as a driving wheel or game controller:

Session Replay

After running a session, use SessionReplay to view a playback of your session, including the car's movement.

Advanced Versions

Contact sales@worldviz.com for information on advanced versions:

Adding Ramps/Elevation Detection (SightLab 1.9.8 or higher)

360 Driving Simulator Instructions (Available Upon Request)

Controls

Notes

Additional Information