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

# HeightMap

## HeightMap

Inherits from: `object`

A class to represent a height map, typically derived from LiDAR or depth data.

Attributes:
data (np.ndarray): A 2D numpy array where each cell contains a height value.
The shape is (height, width).
resolution (float): The size of each cell in meters. For example, a resolution
of 0.1 means each cell is 0.1m x 0.1m.
origin (Position): The 3D world coordinates (x, y, z) of the corner of the
cell (0,0) in the height map data.

### get\_world\_coordinates

```python theme={null}
HeightMap.get_world_coordinates() -> Tuple[np.ndarray, np.ndarray, np.ndarray]
```

Calculates the 3D world coordinates of each cell in the height map.

The (i, j)-th cell in the `data` array corresponds to a physical location.
This method computes the X, Y, and Z coordinates for all cells.
X and Y are grids representing the planar coordinates.
Z is the height data itself.

<ResponseField name="Returns">
  <ResponseField name="returns" type="Tuple[np.ndarray, np.ndarray, np.ndarray]" />
</ResponseField>

### to\_dict

```python theme={null}
HeightMap.to_dict() -> dict
```

Serialize to dictionary for JSON transfer

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

### from\_dict

```python theme={null}
HeightMap.from_dict(data: dict) -> 'HeightMap'
```

Deserialize from dictionary

<ResponseField name="Arguments">
  <ParamField query="data (dict)" type="dict" required>
    *No description provided.*
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="returns" type="'HeightMap'" />
</ResponseField>
