## Core Concepts

This document introduces key terms and design concepts in gyro sweeper vacuum development to help you better understand the platform architecture.

### Map Data Solution

In addition to general device control functions, gyro sweeper vacuums usually need to have map rendering capabilities on the panel. Due to characteristics such as large data volume and incremental transmission, map data is not transmitted through dp points, but through [MQTT stream service](https://developer.tuya.com/cn/docs/mcu-standard-protocol/mcusdk-wifi-robot?id=Kd2fvtzq3wifp).

### MQTT Map Data Protocol

Messages obtained from the MQTT stream service may contain one or more map data packets, each with the format:

```
[Header][MapDataChunk]
```

Where:

- **Header**: 26-byte header information
  - Bytes 0-3: Map ID (hexadecimal)
  - Bytes 4-21: Reserved/other information
  - Bytes 22-25: Data length (hexadecimal, representing the number of bytes of subsequent data / 2)
- **MapDataChunk**: Actual map data segment
  - Length is the number of bytes specified in Header \* 2

### Map Data Point Format

Map data strings consist of a series of point information, where each point may use either a 6-byte or 10-byte format (depending on the map resolution reported by the map parameter dp):

#### 6-byte Format (for resolution \<= 255)

```
XXYYZZ
```

- `XX`: X coordinate (hexadecimal, 0-255)
- `YY`: Y coordinate (hexadecimal, 0-255)
- `ZZ`: Point type (01=cleaning point, 02=obstacle, 03=current position, 04=charging dock, 00=unknown)

#### 10-byte Format (for resolution > 255)

```
XXXXYYYYZZ
```

- `XXXX`: X coordinate (hexadecimal, larger range)
- `YYYY`: Y coordinate (hexadecimal, larger range)
- `ZZ`: Point type (same as 6-byte format)

