AirGenCar

Inherits from: WheeledRobot

A wheeled robot implementation for the AirGen simulator.

This class provides an interface to control a simulated car in the AirGen environment. It inherits from WheeledRobot and implements the necessary methods for movement, sensor data collection, and state management.

The AirGenCar connects to the AirGen simulator and provides methods to:

  • Control the car’s movement through velocity commands
  • Get sensor data like camera images
  • Track and manage the car’s state
  • Reset and undo actions

To access the underlying AirGen API, use the AirGenCar.client field.

AirGenCar

AirGenCar()

Initialize the AirGenCar agent.

Connects to the AirGen simulator, confirms the connection, enables API control, and initializes state tracking.

reset

AirGenCar.reset()

setCarControls

AirGenCar.setCarControls(steering: float, throttle: float, brake: float)

Control the car using throttle, steering, brake

Arguments
steering (float)
required

-1 to 1

throttle (float)
required

0 to 1

brake (float)
required

0 to 1

Returns

setCarTargetSpeed

AirGenCar.setCarTargetSpeed(velocity: float)

Set the target speed for the car

Arguments
velocity (float)
required

desired speed of the car

Returns

rotate

AirGenCar.rotate(rate: float, duration: Union[float, None])

Rotate the car in place by applying handbrake and steering

Arguments
rate (float)
required

Throttle rate to apply during rotation. Positive rotates right, negative rotates left

duration (optional, Union[float, None])
required

How long to rotate in seconds

Returns

getCarState

AirGenCar.getCarState()

Get the current state of the car

getCarControls

AirGenCar.getCarControls()

Get the current control values of the car

getPosition

AirGenCar.getPosition()

Get the current position of the car with respect to the world coordinate.

getOrientation

AirGenCar.getOrientation()

Return the current orientation of the car in radians

getImage

AirGenCar.getImage(camera_name: str, image_type: str)

Return the image of camera (camera_name) with image type (image_type)

Arguments
camera_name (str)
required

name of the camera, one of front_center or bottom_center

image_type (str)
required

supported image types,

Returns

Image

requested image

getVelocity

AirGenCar.getVelocity()

Get the velocity of the car

Was this page helpful?