Examples

To help you getting started wih our library, we have added a collection of examples illustrating our features. This guide helps exploring the collection and can help in finding examples for specific problems and features.

For getting started we suggest taking a look at the following examples:

More quick usage examples can be found in our test suite.

Name

How to

Feature Overview

  • see the basics of what can be done with BeamNGpy

Scenario Control

  • understand the different ways of creating, loading and controlling scenarios

Modding Interface

  • write and deploy a mod that interacts with BeamNGpy
  • write python functions that interact with functions of the custom mod

Road Network

  • fetch information about the current level's road network

AI Line

  • use the simulator's AI with BeamNGpy

AI Waypoints

  • use the simulator's AI with BeamNGpy

Annotation and Bounding Boxes

  • get semantic annotations
  • get instance annotations
  • draw bounding boxes (note that this feature is not ready for use yet)

Settings

  • change the simulation's graphics settings

Checkpoints

  • add checkpoints to custom scenarios

West Coast LiDAR

  • use the LiDAR sensor

Multiple Clients

  • connect multiple BeamNGpy instances to the simulation

Multishot Camera

  • change the position and rotation of a camera

Object Placement

  • define a custom scenario for a given map
  • generate procedural content, i.e. simple meshes

Procedural Meshes

  • generate procedural content

Road Definition

  • add custom roads to given maps

Advanced Driver Comfort Analysis

  • use the Advanced IMU sensor

Spawning

  • spawn a new vehicle after starting the scenario

Ultrasonic Sensor

  • use the ultrasonic sensor

Vehicle Road Bounding Box

  • create a custom road
  • extract road information from the simulation
  • get a vehicle's bounding box

Vehicle State Plotting

  • use the state sensor

East Coast Random

  • create a simple scenario
  • use the simulator's AI with BeamNGpy

Powertrain Analysis

  • use the Powertrain sensor

Road Network Exporter

  • Export BeamNG maps as .xodr files (OpenDRIVE).
  • The exported road networks contain elevation and road wideness data, along with junction connectivity.
  • BeamNGpy also includes a new class with which to analyse the road network data oneself, and process it as required.

Road Network Importer

  • Import a road network from different formats

Platooning

  • form a vehicle platooning formation with BeamNGpy

Parking Assist and Blind Spot Detection

  • get parking assistance
  • blind spot HUD notifications

Lane-Keeping Assist

  • automatically limit vehicle speed based on road curvature
  • force feedback on accidental lane exit

West Coast Radar

  • use the RADAR sensor

West Coast IMU

  • use the IMU sensor

ACC Test

  • use the radar for adaptive cruise control

Camera Streaming

  • stream camera images

Faster Than Realtime

  • run the simulation at a faster rate than realtime

GPS Trajectory

  • get the GPS trajectory of a vehicle

Heightmap Importer

  • import a heightmap

Ideal RADAR Sensor IDs Tracking

  • track objects with the Ideal RADAR sensor

Ideal RADAR Sensor Plot Data

  • plot data from the Ideal RADAR sensor

Import Peaks and Roads

  • import peaks and roads

Map Sensor Configuration

  • polling all sensors of a configuration

Radar Analysis

  • analyze radar data

Roads Plot

  • plotting a road profile

Small Grid IMU

  • use the IMU sensor

Traffic Configuration

  • configure traffic

Vehicle Logging

  • log vehicle data

Vehicle Mesh Data

  • get vehicle mesh data

Vehicle Sensor Configuration

  • configure the vehicle sensors