> ## 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.

# AirGenDrone

## AirGenDrone

Inherits from: [`AerialDrone`](/robot-api/reference/base/robot/aerial_drone/AerialDrone)

AirGen simulation multirotor drone implementation.

This class provides an interface to control simulated multirotor drones in AirGen
using the MultirotorClient from the pyairgen library.

### Inherited methods

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

### **init**

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

Initialize a simulated AirGen multirotor 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: 41461)
  </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>

### takeoff

```python theme={null}
AirGenDrone.takeoff() -> None
```

Command the drone to take off and hover.

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

### land

```python theme={null}
AirGenDrone.land() -> None
```

Command the drone to land at its current position.

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

### getState

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

Get the current state of the drone.

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

### getImage

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

### getPosition

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

Get the position of the drone in the world frame.

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

### getOrientation

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

Get the orientation of the drone 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>

### moveToPosition

```python theme={null}
AirGenDrone.moveToPosition(position: Position, velocity: float, timeout_sec: float = 60) -> None
```

Move the drone to a specified position in the world frame.

<ResponseField name="Arguments">
  <ParamField query="position (Position)" type="Position" required>
    Target position in meters (x, y, z).
  </ParamField>

  <ParamField query="velocity (float)" type="float" required>
    Velocity in m/s.
  </ParamField>

  <ParamField query="timeout_sec (float)" type="float">
    Timeout for the operation in seconds. (default: 60)
  </ParamField>
</ResponseField>

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

### moveByVelocity

```python theme={null}
AirGenDrone.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, duration: float = 1.0, frame: str = 'body') -> None
```

Move the drone with a velocity command in m/s.

The command applies for the given duration. For the body frame, velocity is
relative to the drone's orientation. For the world frame, velocity is in the
global coordinate system.

<ResponseField name="Arguments">
  <ParamField query="linear_velocity (Velocity)" type="Velocity" required>
    Linear velocity in m/s (x, y, z).
  </ParamField>

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

  <ParamField query="duration (float)" type="float">
    Duration in seconds for the command to apply. (default: 1.0)
  </ParamField>

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

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

### cleanup

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

Clean up resources and disarm the drone.

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

### stop

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

Stop the drone by commanding zero velocity.

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