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

## AirGenDrone

Inherits from: [AerialRobot](/robot-api/grid/robot/aerial/aerial_robot#aerialrobot)

### AirGenDrone

```python
AirGenDrone()
```

Set up client and connect to airgen

Args: None

Returns: None

### record\_state

```python
AirGenDrone.record_state()
```

### undo

```python
AirGenDrone.undo()
```

### reset

```python
AirGenDrone.reset()
```

### try\_cancel\_robot\_last\_task

```python
AirGenDrone.try_cancel_robot_last_task()
```

### setVelocity

```python
AirGenDrone.setVelocity(velocity: float)
```

Set the velocity of the drone for moving instructions

<ResponseField name="Arguments">
  <ParamField query="velocity (float)" type="" required>
    velocity in meters per second
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### moveByVelocity

```python
AirGenDrone.moveByVelocity(velocity: Velocity, duration: int, frame: str, blocking: bool)
```

Fly the drone with `velocity` for the specified `duration` of seconds with respect to chosen frame (NED or Nav).

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

    Velocity type containing the three axis (X, Y, Z) velocity with respect to selected frame
  </ParamField>

  <ParamField query="duration (int)" type="" required>
    number of seconds that the drone should be moving
  </ParamField>

  <ParamField query="frame (str), optional" type="">
    the frame of reference for the velocity vector, one of {"ned", "nav"} (default: "ned")
  </ParamField>

  <ParamField query="blocking (bool), optional" type="">
    whether the function should block until the drone finishes moving (default: True)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### takeoff

```python
AirGenDrone.takeoff()
```

Takeoff the aerial robot

### land

```python
AirGenDrone.land()
```

Land the aerial robot

### getPosition

```python
AirGenDrone.getPosition()
```

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

### moveToPosition

```python
AirGenDrone.moveToPosition(position: Position, blocking: bool)
```

Move the drone to absolute position: (x\_val, y\_val, z\_val) with respect to world coordinate frame.

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

    target position of type Position(x, y, z) in meters with respect to the world coordinate
  </ParamField>

  <ParamField query="blocking (bool), optional" type="">
    whether the function should block until the drone finishes moving (default: True)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

#### Examples

```python

    >>> # move the drone to coordinate (20.0, 100.0, 30.0), no need to flip the sign of z when a complete position (x_val, y_val, z_val) is specified
    >>> drone.moveToPosition(Position(20.0, 100.0, 30.0))

```

### moveToPositionDelta

```python
AirGenDrone.moveToPositionDelta(position_delta: Position, frame: str, blocking: bool)
```

Move the drone by position\_delta: (x\_val, y\_val, z\_val) relative to the current location with respect to selected frame.

<ResponseField name="Arguments">
  <ParamField query="position_delta (Position)" type="" required>
    [Position](/robot-api/grid/utils/types#position)

    delta position of type Position(x, y, z) in meters with respect to the world coordinate
  </ParamField>

  <ParamField query="frame (str)" type="" required>
    the frame of reference for the position vector, one of {"ned", "nav"} (default: "ned")
  </ParamField>

  <ParamField query="blocking (bool), optional" type="">
    whether the function should block until the drone finishes moving (default: True)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### moveToGPS

```python
AirGenDrone.moveToGPS(lat: float, lng: float, alt: float, blocking: bool)
```

Move the drone to gps coordinate: (lat, lng, alt)

<ResponseField name="Arguments">
  <ParamField query="lat (float)" type="" required>
    latitude
  </ParamField>

  <ParamField query="lng (float)" type="" required>
    longitude
  </ParamField>

  <ParamField query="alt (float)" type="" required>
    altitude
  </ParamField>

  <ParamField query="blocking (bool), optional" type="">
    whether the function should block until the drone finishes moving (default: True)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### setYaw

```python
AirGenDrone.setYaw(yaw: float, blocking: bool)
```

Set the yaw (in radians) of the drone to the specified degrees. Yaw measures the
rotation of the drone around the z-axis (downwards)

<ResponseField name="Arguments">
  <ParamField query="yaw (float)" type="" required>
    the target yaw (radians) for the drone
  </ParamField>

  <ParamField query="blocking (bool), optional" type="">
    whether the function should block until the drone finishes moving (default: True)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### setYawDelta

```python
AirGenDrone.setYawDelta(yaw_delta: float, blocking: bool)
```

Set a yaw delta (in radians) for the drone to rotate to. Yaw measures the
rotation of the drone around the z-axis (downwards).

<ResponseField name="Arguments">
  <ParamField query="yaw_delta (float)" type="" required>
    the change in yaw (radians) for the drone
  </ParamField>

  <ParamField query="blocking (bool), optional" type="">
    whether the function should block until the drone finishes moving (default: True)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### getYaw

```python
AirGenDrone.getYaw()
```

Return the current yaw of the drone in radians. Yaw measures the rotation of the drone

### getOrientation

```python
AirGenDrone.getOrientation()
```

Return the current orientation of the drone in radians

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

  Current orientation of the drone in Orientation type with pitch, roll, and yaw in radians
</ResponseField>

### getImage

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

return the image of camera(camera\_name) with the drone's current position and pose

<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)

  Image type containing the requested image and the camera parameters of capture.
</ResponseField>
