> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AirGenCar

## AirGenCar

Inherits from: [`Wheeled`](/robot-api/reference/base/robot/wheeled/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

* From [`Robot`](/robot-api/reference/base/robot/robot/Robot): `addSensor`

### **init**

```python theme={null}
AirGenCar.__init__(ip: str = '127.0.0.1', port: int = 41471, timeout_value: int = 3600, vehicle_name: str = '')
```

Initialize a simulated AirGen car client.

<ResponseField name="Arguments">
  <ParamField query="ip (str)" type="str">
    IP address of the AirGen server. (default: "127.0.0.1")
  </ParamField>

  <ParamField query="port (int)" type="int">
    Port number for the AirGen server. (default: 41471)
  </ParamField>

  <ParamField query="timeout_value (int)" type="int">
    Timeout value for the connection in seconds. (default: 3600)
  </ParamField>

  <ParamField query="vehicle_name (str)" type="str">
    Name of the vehicle in the simulation. (default: "")
  </ParamField>
</ResponseField>

### getState

```python theme={null}
AirGenCar.getState() -> dict
```

Get the current state of the car.

<ResponseField name="Returns">
  <ResponseField name="dict" type="dict">
    Current state including position, orientation, and velocity.
  </ResponseField>
</ResponseField>

### getPosition

```python theme={null}
AirGenCar.getPosition() -> Optional[Position]
```

Get the position of the car in the world frame.

<ResponseField name="Returns">
  <ResponseField name="Optional[Position]" type="Optional[Position]">
    Current position of the car in world coordinates.
  </ResponseField>
</ResponseField>

### getOrientation

```python theme={null}
AirGenCar.getOrientation() -> Optional[Orientation]
```

Get the orientation of the car in the world frame.

<ResponseField name="Returns">
  <ResponseField name="Optional[Orientation]" type="Optional[Orientation]">
    Current orientation as a quaternion (x, y, z, w).
  </ResponseField>
</ResponseField>

### getImage

```python theme={null}
AirGenCar.getImage(camera_name: str = 'front_center', image_type: str = 'rgb') -> Image
```

Get an image from the specified camera.

<ResponseField name="Arguments">
  <ParamField query="camera_name (str)" type="str">
    Name of the camera in the AirGen scene. (default: "front\_center")
  </ParamField>

  <ParamField query="image_type (str)" type="str">
    Image type, one of ("rgb"|"depth"). (default: "rgb")
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="Image" type="Image">
    Captured image wrapped in the project's Image type.
  </ResponseField>
</ResponseField>

### moveByVelocity

```python theme={null}
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.

<ResponseField name="Arguments">
  <ParamField query="linear_velocity (Velocity)" type="Velocity" required>
    Linear velocity in m/s (x\_vel used for forward speed).
  </ParamField>

  <ParamField query="angular_velocity (Velocity)" type="Velocity" required>
    Angular velocity in rad/s (z\_vel/yaw rate is used).
  </ParamField>

  <ParamField query="frame (str)" type="str">
    Reference frame for velocity ("body" only). (default: "body")
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>

### stop

```python theme={null}
AirGenCar.stop() -> None
```

Stop the car by zeroing target speed and controls.

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>

### cleanup

```python theme={null}
AirGenCar.cleanup() -> None
```

Clean up resources and disable API control.

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>
