Skip to main content

AirGenCar

Inherits from: Wheeled AirGen simulation car implementation. This class provides an interface to control simulated wheeled cars in AirGen using the CarClient from the pyairgen library.

Inherited methods

init

AirGenCar.__init__(ip: str = '127.0.0.1', port: int = 41471, timeout_value: int = 3600, vehicle_name: str = '')
Initialize a simulated AirGen car client.
Arguments
ip (str)
str
IP address of the AirGen server. (default: “127.0.0.1”)
port (int)
int
Port number for the AirGen server. (default: 41471)
timeout_value (int)
int
Timeout value for the connection in seconds. (default: 3600)
vehicle_name (str)
str
Name of the vehicle in the simulation. (default: "")

getState

AirGenCar.getState() -> dict
Get the current state of the car.
Returns
dict
dict
Current state including position, orientation, and velocity.

getPosition

AirGenCar.getPosition() -> Optional[Position]
Get the position of the car in the world frame.
Returns
Optional[Position]
Optional[Position]
Current position of the car in world coordinates.

getOrientation

AirGenCar.getOrientation() -> Optional[Orientation]
Get the orientation of the car in the world frame.
Returns
Optional[Orientation]
Optional[Orientation]
Current orientation as a quaternion (x, y, z, w).

getImage

AirGenCar.getImage(camera_name: str = 'front_center', image_type: str = 'rgb') -> Image
Get an image from the specified camera.
Arguments
camera_name (str)
str
Name of the camera in the AirGen scene. (default: “front_center”)
image_type (str)
str
Image type, one of (“rgb”|“depth”). (default: “rgb”)
Returns
Image
Image
Captured image wrapped in the project’s Image type.

moveByVelocity

AirGenCar.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, frame: str = 'body') -> None
Move the car with a velocity command. For cars, velocity control is limited. The linear_velocity.x_vel controls forward/backward speed, and angular_velocity.z_vel controls turning rate.
Arguments
linear_velocity (Velocity)
Velocity
required
Linear velocity in m/s (x_vel used for forward speed).
angular_velocity (Velocity)
Velocity
required
Angular velocity in rad/s (z_vel/yaw rate is used).
frame (str)
str
Reference frame for velocity (“body” only). (default: “body”)
Returns
returns
None

stop

AirGenCar.stop() -> None
Stop the car by zeroing target speed and controls.
Returns
returns
None

cleanup

AirGenCar.cleanup() -> None
Clean up resources and disable API control.
Returns
returns
None