Coder Social home page Coder Social logo

Comments (20)

FeatureExpert avatar FeatureExpert commented on May 26, 2024 2

3.3.9_001633

Lab mode ON:

req: {'from': '4', 'id': ##MESSAGE_ID##, 'method': 'set_lab_status', 'params': [1]}
res: {'id': ##MESSAGE_ID##, 'result': ['ok']}

Lab mode OFF:

req: {'from': '4', 'id': ##MESSAGE_ID##, 'method': 'set_lab_status', 'params': [0]}
res: {'id': ##MESSAGE_ID##, 'result': ['ok']}

Software barrier:

req: {'from': '4', 'id': 666, 'method': 'save_map', 'params': [[1, 33800, 27850, 34900, 28700]]}
res: {'id': ##MESSAGE_ID##, 'result': ['ok']}

No-go zone:

req: {'from': '4', 'id': ##MESSAGE_ID##, 'method': 'save_map', 'params': [[0, 27000, 32000, 30750, 32000, 30750, 30250, 27000, 30250]]}
res: {'id': ##MESSAGE_ID##, 'result': ['ok']}

from xiaomirobotvacuumprotocol.

FeatureExpert avatar FeatureExpert commented on May 26, 2024 1

You are probably right. So we can set coords as follows counting from bottom left corner and where the dock is at [25500, 25500]:

[id, barrier_start_x, barrier_start_y, barrier_end_x, barrier_end_y]

or

[id, zone_top_left_x, zone_top_left_y, zone_top_right_x, zone_top_right_y, zone_bottom_right_x, zone_bottom_right_y, zone_bottom_left_x, zone_bottom_left_y]

or even barrier and no-go zone in one command:

[[id, barrier_start_x, barrier_start_y, barrier_end_x, barrier_end_y], [id, zone_top_left_x, zone_top_left_y, zone_top_right_x, zone_top_right_y, zone_bottom_right_x, zone_bottom_right_y, zone_bottom_left_x, zone_bottom_left_y]]

from xiaomirobotvacuumprotocol.

JensBuchta avatar JensBuchta commented on May 26, 2024 1

Seems the first argument of the array is not an id, but rather a type: 0 = zone, 1 = barrier.
I can create multiple zones with 0, one zone 0, next zone 1 didn't work. Tested with FW 1633.

from xiaomirobotvacuumprotocol.

cryptomilk avatar cryptomilk commented on May 26, 2024

I'm also seeing:

get_fresh_map_v2
get_fresh_map
get_persist_map_v2
get_persist_map

It is also possible that persistent maps are stored in the mii cloud and downloaded if requested.

from xiaomirobotvacuumprotocol.

JohnRev avatar JohnRev commented on May 26, 2024

Thanks for sharing these, @FeatureExpert!!
The params of software barrier and no-go zones seem like coordinates?
Software barrier takes a vector of [id, x1,y1,x2,y2]
And no-go zone takes [id, x1,y1,x2,y2,x3,y3,x4,y4], which are the corners of the zone rectangle?
Edit: see @JensBuchta's comment. The first parameter appears to be a type: 0 = zone, 1 = barrier

from xiaomirobotvacuumprotocol.

dugite-code avatar dugite-code commented on May 26, 2024

It looks like these features are yet to be ported to the Gen 1 Firmware. But given the similarities I would hope to see it soon

from xiaomirobotvacuumprotocol.

FeatureExpert avatar FeatureExpert commented on May 26, 2024

I'm not sure these numbers. Some kind of coordinates for sure, but I do not know yet how to calculate them correctly. My image with the map is 900x767, so the coordinates does not match the size. But maybe I generate map incorrectly...

from xiaomirobotvacuumprotocol.

Youkier avatar Youkier commented on May 26, 2024

Hi,

This may be a stupid question but how can you get the list of the commands ?
I did not find any explanation of the robot API.

Thanks

from xiaomirobotvacuumprotocol.

JohnRev avatar JohnRev commented on May 26, 2024

@FeatureExpert I guess they would be like the zoned_cleanup coordinate system, where the dock is at (2500,2500) or something like that

from xiaomirobotvacuumprotocol.

JohnRev avatar JohnRev commented on May 26, 2024

@JensBuchta nice find!

from xiaomirobotvacuumprotocol.

usbdem avatar usbdem commented on May 26, 2024

You are probably right. So we can set coords as follows counting from bottom left corner and where the dock is at [25500, 25500]:

[id, barrier_start_x, barrier_start_y, barrier_end_x, barrier_end_y]

or

[id, zone_top_left_x, zone_top_left_y, zone_top_right_x, zone_top_right_y, zone_bottom_right_x, zone_bottom_right_y, zone_bottom_left_x, zone_bottom_left_y]

or even barrier and no-go zone in one command:

[[id, barrier_start_x, barrier_start_y, barrier_end_x, barrier_end_y], [id, zone_top_left_x, zone_top_left_y, zone_top_right_x, zone_top_right_y, zone_bottom_right_x, zone_bottom_right_y, zone_bottom_left_x, zone_bottom_left_y]]

sorry for my stupid question : how are no-go zones and barriers removed or how can i see these zones or barriers ?

from xiaomirobotvacuumprotocol.

cryptomilk avatar cryptomilk commented on May 26, 2024

Calling get_persistent_map_v1 triggers a map upload. However I'm not sure what the param does. With the new Valetudo which supports map uploading, I've added a log message and it uploads a map each time I call it.

from xiaomirobotvacuumprotocol.

cryptomilk avatar cryptomilk commented on May 26, 2024

It looks like it is a slot, it seems you can switch between 0 and 1.

 asn  (e) venv  ~  workspace  rockrobo  miio  mirobo raw-command get_persist_map_v1 1
Sending cmd get_persist_map_v1 with params 1
['retry']
 asn  (e) venv  ~  workspace  rockrobo  miio  mirobo raw-command get_persist_map_v1 0
Sending cmd get_persist_map_v1 with params 0
['map_upload_handler']
 asn  (e) venv  ~  workspace  rockrobo  miio  mirobo raw-command get_persist_map_v1 0
Sending cmd get_persist_map_v1 with params 0
['retry']
 asn  (e) venv  ~  workspace  rockrobo  miio  mirobo raw-command get_persist_map_v1 1
Sending cmd get_persist_map_v1 with params 1
['map_upload_handler']

from xiaomirobotvacuumprotocol.

cryptomilk avatar cryptomilk commented on May 26, 2024

get_persist_map_v1 only works after save_map. If you do a reset_map it doesn't work anmyore.

from xiaomirobotvacuumprotocol.

Hypfer avatar Hypfer commented on May 26, 2024

So how do you remove virtual walls and no-go zones?

from xiaomirobotvacuumprotocol.

Thyraz avatar Thyraz commented on May 26, 2024

Any news on this, did someone figure out how to delete virtual walls or no-go zones,
or how to reset all virtual walls + all no go-zones with some kind of reset (without loosing the peristant map)?

Maybe the original app doesn't delete single entities, but resets all and re-builds the other ones.

from xiaomirobotvacuumprotocol.

FeatureExpert avatar FeatureExpert commented on May 26, 2024

If you want to remove all walls and zones:

{'from': '4', 'id': 666, 'method': 'save_map', 'params': []}

from xiaomirobotvacuumprotocol.

cryptomilk avatar cryptomilk commented on May 26, 2024

If you want to remove one part, you parse the current map file, remove the part you don't want and call save_map with the params you want.

from xiaomirobotvacuumprotocol.

Shurov avatar Shurov commented on May 26, 2024

Can we somehow edit map background in a user friendly way?
What I mean is... e,g, when robot scans near a mirror - there are beams drawn on a map that go outside the room\house
image
(the screen taken from Valetudo, but it shouldn't matter).
I'd like to clean up the map for it to look nicer.
I have map json file downloaded, but it's 700kb of text\numbers, so really hard to track each point's coordinates. Thus some app/UI would be nice.

from xiaomirobotvacuumprotocol.

marcelrv avatar marcelrv commented on May 26, 2024

This is nothing you can simply set in the request, nor is there an obvious way to avoid it.
The Xiaomi cloud offers a basic bitmap with the colors including the reflections you see.

Besides that it offers the location of the various objects & tracks etc.

You might be able to create a client that does some smart things to the bitmap, to determine if it is part of a larger(largest) cloud of pixels or something, but that would be totally client dependent.

from xiaomirobotvacuumprotocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.