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
Initialize the AirGenCar agent.
Connects to the AirGen simulator, confirms the connection, enables API control,
and initializes state tracking.
reset
setCarControls
AirGenCar.setCarControls(steering: float, throttle: float, brake: float)
Control the car using throttle, steering, brake
setCarTargetSpeed
AirGenCar.setCarTargetSpeed(velocity: float)
Set the target speed for the car
rotate
AirGenCar.rotate(rate: float, duration: Union[float, None])
Rotate the car in place by applying handbrake and steering
Throttle rate to apply during rotation. Positive rotates right, negative rotates left
duration (optional, Union[float, None])
How long to rotate in seconds
getCarState
Get the current state of the car
getCarControls
AirGenCar.getCarControls()
Get the current control values of the car
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)
name of the camera, one of front_center or bottom_center
getVelocity
Get the velocity of the car
moveByVelocity (inherited)
AirGenCar.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, duration: float | None)
Move the robot by setting linear and angular velocity.
linear_velocity (Velocity)
VelocityLinear velocity object containing x_vel component angular_velocity (Velocity)
VelocityAngular velocity object containing z_vel component duration (float | None), optional
defaults to None.
Optional duration in seconds to move for before stopping. Defaults to None.