> ## Documentation Index
> Fetch the complete documentation index at: https://scaledfoundations-rebrand.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AirGen Car

## AirGenCar

Inherits from: [WheeledRobot](/robot-api/grid/robot/wheeled/wheeled_robot#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

<Note>
  To access the underlying AirGen API, use the `AirGenCar.client` field.
</Note>

### AirGenCar

```python
AirGenCar()
```

Initialize the AirGenCar agent.

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

### reset

```python
AirGenCar.reset()
```

### setCarControls

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

Control the car using throttle, steering, brake

<ResponseField name="Arguments">
  <ParamField query="steering (float)" type="" required>
    -1 to 1
  </ParamField>

  <ParamField query="throttle (float)" type="" required>
    0 to 1
  </ParamField>

  <ParamField query="brake (float)" type="" required>
    0 to 1
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### setCarTargetSpeed

```python
AirGenCar.setCarTargetSpeed(velocity: float)
```

Set the target speed for the car

<ResponseField name="Arguments">
  <ParamField query="velocity (float)" type="" required>
    desired speed of the car
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### rotate

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

Rotate the car in place by applying handbrake and steering

<ResponseField name="Arguments">
  <ParamField query="rate (float)" type="" required>
    Throttle rate to apply during rotation. Positive rotates right, negative rotates left
  </ParamField>

  <ParamField query="duration (optional, Union[float, None])" type="" required>
    How long to rotate in seconds
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### getCarState

```python
AirGenCar.getCarState()
```

Get the current state of the car

### getCarControls

```python
AirGenCar.getCarControls()
```

Get the current control values of the car

### getPosition

```python
AirGenCar.getPosition()
```

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

### getOrientation

```python
AirGenCar.getOrientation()
```

Return the current orientation of the car in radians

### getImage

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

Return the image of camera (camera\_name) with image type (image\_type)

<ResponseField name="Arguments">
  <ParamField query="camera_name (str)" type="" required>
    name of the camera, one of `front_center` or `bottom_center`
  </ParamField>

  <ParamField query="image_type (str)" type="" required>
    supported image types, {"rgb", "depth", "segmentation", "surface_normals", "optical_flow", "infrared"}
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  [Image](/robot-api/grid/utils/types#image)

  requested image
</ResponseField>

### getVelocity

```python
AirGenCar.getVelocity()
```

Get the velocity of the car

### moveByVelocity *(inherited)*

```python
AirGenCar.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, duration: float | None)
```

Move the robot by setting linear and angular velocity.

<ResponseField name="Arguments">
  <ParamField query="linear_velocity (Velocity)" type="" required>
    [Velocity](/robot-api/grid/utils/types#velocity)

    Linear velocity object containing x\_vel component
  </ParamField>

  <ParamField query="angular_velocity (Velocity)" type="" required>
    [Velocity](/robot-api/grid/utils/types#velocity)

    Angular velocity object containing z\_vel component
  </ParamField>

  <ParamField query="duration (float | None), optional" type="">
    defaults to None.
    Optional duration in seconds to move for before stopping. Defaults to None.
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />
