Inertial Navigation Robot Vacuum Mapping

Last Updated on : 2025-01-10 03:12:29download

This topic describes the streaming service for robot vacuums, a quick channel to transmit map data between the mobile app and the robot vacuum.

Only specific modules with the required service activated support map streaming services for robot vacuums.

Processes

Inertial Navigation Robot Vacuum Mapping

Description:

  • The map data is identified by the map ID. Data of the same map ID is processed as one cleaning task by the mobile app.
  • The robot vacuum goes around the whole house during cleaning. However, if the wireless signals in some areas are weak, data upload might fail. In this case, with sufficient memory, the module can store 24 pieces of the data cache.

Commands

The following table lists commands used in the map streaming service.

Command Description
0x28 Map streaming
0x3C Map streaming (X/Y coordinates, 2 bytes)
0x34 + 0x06 Get the map session ID

Map streaming

  • For streaming data of a complete map, the map data offset indicates the total length of data that has been sent.

  • The maximum buffer of the module is 6,144 bytes. A packet of map data cannot exceed 256 bytes.

  • The map ID indicates a cleaning map. The robot builds a map of the cleaning area each time it starts a new cleaning task, with a new map ID assigned to it. When the map ID is changed, the map data displayed on the mobile app will be changed accordingly.

  • After data transmission starts, the module will stop sending heartbeats to ensure the map data traffic is prioritized. The heartbeat will not resume unless the module is restarted following a shutdown.

  • When the map ID changes, the first packet offset must be 0.

  • When map data is transferred, the packet offset must be incremented.

  • The payload of a single packet is less than 256 bytes, and the payload of a physical coordinate cannot be split into two packets for transmission.

  • Fill the payload according to the specification. Otherwise, the module will return an error and discard the data. If you need data in other formats, please feel free to contact Tuya for customization.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x28
Data length 2 0x0006 + N
Data 2 Data[0] to Data[1]: The map ID, an identifier for a map created for a cleaning task.
4 Data[2] to Data[5]: The map data offset, which is 0 for the first packet.
N Data[6] to Data[N]: The payload, in big-endian format.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
Payload Bytes Description
Map data reporting (incremented in real time) 1 X coordinate
1 Y coordinate
1
  • 0x00: Current position
  • 0x01: Obstacle
  • 0x02: Cleaned area
  • 0x03: Charging dock
  • 0x04: Reserved

Example: The map ID is 123 and the packet offset is 0.

55 aa 03 28 xx xx 00 7b 00 00 00 00 xx xx xx xx xx

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x28
Data length 2 0x0001
Data 1 Data
  • 0x00: Success
  • 0x01: The streaming service is not enabled.
  • 0x02: Failed to connect to the streaming server.
  • 0x03: Data push timeout.
  • 0x04: Data length error.
  • 0x05: Invalid data.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 00 28 00 01 00 28

Map streaming (X/Y coordinates, 2 bytes)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x3C
Data length 2 0x0006 + N
Data 2 Data[0] to Data[1]: The map ID, an identifier for a map created for a cleaning task.
4 Data[2] to Data[5]: The map data offset, which is 0 for the first packet.
N Data[6] to Data[N]: The payload, in big-endian format.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
Payload Bytes Description
Map data reporting (incremented in real time) 2 X coordinate
2 Y coordinate
1
  • 0x00: Current position
  • 0x01: Obstacle
  • 0x02: Cleaned area
  • 0x03: Charging dock
  • 0x04: Reserved

Example: The map ID is 123 and the packet offset is 0.

55 aa 03 3C xx xx 00 7b 00 00 00 00 xx xx xx xx xx

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x3C
Data length 2 0x0001
Data 1 Data
  • 0x00: Success
  • 0x01: The streaming service is not enabled.
  • 0x02: Failed to connect to the streaming server.
  • 0x03: Data push timeout.
  • 0x04: Data length error.
  • 0x05: Invalid data.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Get the map session ID

  • This command is a supplement to the map streaming service for single and multiple maps.

  • The module manages the map session ID. Before the MCU transmits a new map, it will request a map session ID from the module and include the allocated session ID in each session data transmission. The sub-map ID is incremented by 1 as a new sub-map is added, such as 0x01, 0x02, 0x03, and more.

  • If you prefer to manage the map session ID yourself, this command is not required.

The MCU sends the following data.

Field Length Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x34
Data length 2 0x0001
Data 1 0x06 (subcommand)
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 03 30 00 01 00 33

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x34
Data length 2 0x0004
Data 1 0x06 (subcommand)
1 The transmission result.
  • 0x00: Success
  • 0x01: The streaming service is not enabled.
  • 0x02: Failed to get the ID.
2 The map session ID. If the transmission fails, this data is invalid.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 00 34 00 04 06 00 00 00 3d