Skip to main content
Wheeled robots are driven through airgen.CarClient. Commands revolve around throttle, steering, braking, and optional cruise control.

setCarControls

Directly manipulate throttle, steering, and brakes via the CarControls struct.
import airgen
from airgen.types import CarControls

controls = CarControls()
controls.throttle = 0.4
controls.steering = 0.15  # turn right

client = airgen.CarClient()
client.enableApiControl(True)
client.setCarControls(controls)
Reset the car by sending a fresh CarControls() object with all fields zeroed.

enableCarSpeedControl / setCarTargetSpeed

Let the simulator maintain a requested cruising speed while you adjust steering.
client.enableCarSpeedControl(True)
client.setCarTargetSpeed(6.0)  # meters per second

controls = CarControls()
controls.steering = -0.1  # gentle left turn
client.setCarControls(controls)

moveOnPath

For waypoint-based driving, delegate to the built-in path follower. It accepts the same Vector3r waypoints used by drones.
from airgen.types import Vector3r

road_path = [
    Vector3r(0.0, 0.0, 0.0),
    Vector3r(15.0, 2.0, 0.0),
    Vector3r(30.0, 2.5, 0.0),
]

client.moveOnPath(
    path=road_path,
    velocity=8.0,
    lookahead=-1,
    adaptive_lookahead=1,
)