Skip to content

Include live map support #10

@boriswerner

Description

@boriswerner

In a bumper issue (wpietri/sucks#78) there are details on the Map messages included:

Using the right base64 text, which in turn produces a well-formed lzma compressed stream, I understood that the map piece binary data is a list of pixels encoded as following:
0x00 is used for empty (undiscovered) pixels
0x01 is used for floor pixels
0x02 is used for wall pixels

Following the python script described there to decode that stream

        # Decode Base64
        data = base64.b64decode(b64)
        
        # Get lzma output size (as done by the Android app)
        len_array = data[5:5+4]
        len_value = ((len_array[0] & 0xFF) | (len_array[1] << 8 & 0xFF00) | (len_array[2] << 16 & 0xFF0000) | (len_array[3] << 24 & 0xFF000000)) 
        
        # Init the LZMA decompressor using the lzma header
        dec = lzma.LZMADecompressor(lzma.FORMAT_RAW, None, [lzma._decode_filter_properties(lzma.FILTER_LZMA1, data[0:5])])
        
        # Decompress the lzma stream to get raw data
        return dec.decompress(data[9:], len_value)

During cleaning the Ozmo 950 sends continuosly infos about the maps that could be processed and drawn.
I will do some more analysis on the topic.

Maybe also parts of the project valetudo-mapper for Xiaomi/Roborock vacs (https://github.com/rand256/valetudo-mapper) can be reused/transferred

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestPinnedPinned issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions