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

# Types

## MessageType

Message type for grid to enable message passing and consistency

### MessageType

```python
MessageType()
```

Generic class for any message type.

<ResponseField name="Returns" />

## Position

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent the position of the robot

### Position

```python
Position(x_val: float, y_val: float, z_val: float)
```

A class to represent the position of the robot

<ResponseField name="Arguments">
  <ParamField query="x_val (float)" type="" required>
    x-coordinate value (meters)
  </ParamField>

  <ParamField query="y_val (float)" type="" required>
    y-coordinate value (meters)
  </ParamField>

  <ParamField query="z_val (float)" type="" required>
    z-coordinate value (meters)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

## Orientation

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent the orientation as a quaternion

### Orientation

```python
Orientation(x: float, y: float, z: float, w: float)
```

Initialize orientation as a unit quaternion

<ResponseField name="Arguments">
  <ParamField query="x (float)" type="" required>
    x component of quaternion
  </ParamField>

  <ParamField query="y (float)" type="" required>
    y component of quaternion
  </ParamField>

  <ParamField query="z (float)" type="" required>
    z component of quaternion
  </ParamField>

  <ParamField query="w (float)" type="" required>
    w component of quaternion (scalar)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### from\_euler

```python
Orientation.from_euler(cls, roll: float, pitch: float, yaw: float)
```

Create orientation from Euler angles (roll, pitch, yaw)

<ResponseField name="Arguments">
  <ParamField query="roll (float)" type="" required>
    roll angle around x-axis (radians)
  </ParamField>

  <ParamField query="pitch (float)" type="" required>
    pitch angle around y-axis (radians)
  </ParamField>

  <ParamField query="yaw (float)" type="" required>
    yaw angle around z-axis (radians)
  </ParamField>
</ResponseField>

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

  quaternion representation of the orientation
</ResponseField>

#### Examples

```python

    >>> orientation = Orientation.from_euler(0, 0, 0)

```

### to\_euler

```python
Orientation.to_euler(axes)
```

Convert quaternion to Euler angles (roll, pitch, yaw)

<ResponseField name="Returns">
  Euler angles in radians in (x, y, z) order
</ResponseField>

### to\_list

```python
Orientation.to_list()
```

Convert orientation to a list of floats

<ResponseField name="Returns">
  List of floats representing the orientation
</ResponseField>

## Pose

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent the pose of the robot (Position and Orientation)

### Pose

```python
Pose(position: Position, orientation: Orientation)
```

A class to represent the pose of the robot (Position and Orientation)

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

    The x, y, z position of the robot
  </ParamField>

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

    The orientation as a  quaternion
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

## Velocity

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent the velocity of the robot in NED frame

### Velocity

```python
Velocity(x_vel: float, y_vel: float, z_vel: float)
```

A class to represent the velocity of the robot in NED frame

<ResponseField name="Arguments">
  <ParamField query="x_vel (float)" type="" required>
    x-axis velocity (m/s)
  </ParamField>

  <ParamField query="y_vel (float)" type="" required>
    y-axis velocity (m/s)
  </ParamField>

  <ParamField query="z_vel (float)" type="" required>
    z-axis velocity (m/s)
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

## Image

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent an image

### Image

```python
Image(data, capture_params: dict, img_type: str)
```

A class to represent an image

<ResponseField name="Arguments">
  <ParamField query="data" type="" required>
    image data
  </ParamField>

  <ParamField query="capture_params (dict), optional" type="">
    the parameters of image capture
  </ParamField>

  <ParamField query="img_type (str)" type="" required>
    type of the image ('rgb', 'depth', 'segmentation')
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

## Twist

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent angular and linear velocity in 3D space.

### Twist

```python
Twist(linear: Position, angular: Position)
```

Initialize a Twist message

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

    The linear velocity in x, y, z
  </ParamField>

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

    The angular velocity in x, y, z
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

### to\_dict

```python
Twist.to_dict()
```

Convert to ROS message dictionary format

<ResponseField name="Returns">
  Dictionary matching ROS message format
</ResponseField>

## PointCloud

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent a point cloud

### PointCloud

```python
PointCloud(points: np.ndarray, fields: list)
```

Initialize a point cloud object

<ResponseField name="Arguments">
  <ParamField query="points (np.ndarray)" type="" required>
    Array of points with shape (N, 3+)
  </ParamField>

  <ParamField query="fields (list), optional" type="">
    List of field names. Defaults to \['x', 'y', 'z']
  </ParamField>
</ResponseField>

<ResponseField name="Returns" />

## HeightMap

Inherits from: [MessageType](/robot-api/grid/utils/types#messagetype)

A class to represent a height map from LiDAR data

### HeightMap

```python
HeightMap(data: np.ndarray, resolution: float, origin: Position)
```

Initialize the height map

<ResponseField name="Arguments">
  <ParamField query="data (np.ndarray)" type="" required>
    2D array of height values
  </ParamField>

  <ParamField query="resolution (float)" type="" required>
    meters per cell
  </ParamField>

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

    position of the height map origin in world coordinates
  </ParamField>
</ResponseField>

### process

```python
HeightMap.process()
```

Process the height map to return coordinates accounting for resolution and origin

<ResponseField name="Returns">
  Tuple containing:
  np.ndarray: X coordinates grid
  np.ndarray: Y coordinates grid
  np.ndarray: Height values
</ResponseField>
