rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
667 stars 73 forks source link

Zone cleanup leads to loosing orientation and dock station location #183

Closed uhrb closed 4 years ago

uhrb commented 4 years ago

0.9.1 if u running zone cleanup, you almost always can face the situation, when vacuum get lost or coordinate system is moved and it does not understand where is base station

How to Reproduce

Expected behavior

Not lost orientation. Screenshots

Vacuum Model: Gen1 Valetudo Version: 0.9.1 Valetudo RE User-Agent Not related Additional context

pidator commented 4 years ago

... when vacuum get lost or coordinate system is moved

Can you explain this? How do this happen? What are you doing? I've never had an situation like this with my Gen1 and zoned cleaning...!?

uhrb commented 4 years ago

Its not 100%, but stilll happens often (I have about 4 times such thing happened in about 20 cleanings). I think it is somehow relates to situation when I manually stop "whole thing" cleanup, and then start zone. I think i explained it little bit in issue description. However, maybe I am not clean on explaining what actually happens. When i perform actions described, there are two things may happen:

  1. Robot can just lost it base station location and whole coordinate system get rotated
  2. Robot can just "move" (0,0) coordinate "up" or "down" (on a Map it looks like he start drawing new shapes for obstacles and they are the same as before, but moved for meter or so "up" or "down")
pidator commented 4 years ago

It's neccessary to describe exactly what you're doing and what commands are set in which situations! Unfortunately you haven't described it detailed in issue description. Personally zoned cleaning is the only cleaning method I'm using and I've never had this issue before.

So, losing of base station location and rotation of the coordinate system is normal behaviour of Gen1 devices when starting a cleaning with the "Start"-button! The Gen1 will always create a new map after pushing the Start button, this can't be changed. To avoid this, the only way is to use "zoned cleaning" only. This way you can prevent losing your current map.

uhrb commented 4 years ago

I am not sure what the expected issue format, however I tried to do my best. I am aware about map re-creating when start button is pressed, but it is not related to situation at all from my perspective. The issue is that even map was at least partially created, it not followed sometimes when zone cleanup is performed by using this map. Still an issue from my point of view, related to valetudo re (at least from UI/UX point of view). I would say that i am experiencing the exactly issue, described here https://www.reddit.com/r/Xiaomi/comments/93jn39/rotated_map_bug_on_the_xiaomi_roborock_s50_vacuum/

pidator commented 4 years ago

What base firmware is your robot runnig? (Settings -> Info -> Firmware-Version)

uhrb commented 4 years ago

It was flashed to valetudo re directly after factory reset. firmware version: 004007. miio-client: 3.3.9 valetudo re: 0.9.1

rand256 commented 4 years ago

I think it is somehow relates to situation when I manually stop "whole thing" cleanup, and then start zone

When you run "whole thing", the map on Gen1 is always recreated, and it can be rotated to whatever side. That could be changed only by the manufacturer.

When i perform actions described, there are two things may happen

Unfortunately you don't describe the actions: you don't say where and how do you run cleaning, and this is important.

In example, do you start cleaning when the device stands on the dock? If so, does the dock stay at proper location? The manual defines it should have some minimal distances to nearest obstacles; I have dock position for my Gen2 failed those requirements, and if I manually put the device at it, the robot quiet often can't get its position when leaves the dock. So when I have to clean device's main brush, I remember to put the device back near the dock and have it go onto it itself. Cause when it approaches the dock itself, it remembers its position and don't have to check its position when leaving the dock, so no risk to lose the map.

If you start the cleaning elsewhere, and you've picked up the robot from the floor (i.e. for cleaning the brushes), remember putting it back far enough from the walls, cause otherwise it may fail to get its position and start redrawing a map above the already existing map at the wrong place. At least that's what my Gen2 does.

Still an issue from my point of view, related to valetudo re (at least from UI/UX point of view)

And for this I'll just say that it's nothing to be done on valetudo's side, as it simply calls available miio commands on the device, and only device's firmware decides how to run them exactly. We can change nothing in it, there are no magical parameters in starting zoned cleaning command that could be put wrong.

uhrb commented 4 years ago

Unfortunately you don't describe the actions: you don't say where and how do you run cleaning, and this is important.

Guys, I think I already described it,: 1. "i starting whole thing cleanup by using web interface". 2. Stop it using web interface. 3. Start zone cleanup using web interface.

Answering you questions:

  1. do you start cleaning when the device stands on the dock? Yes. its obvious.
  2. if so, does the dock stay at proper location? Proper location? Yes, its again obvious. I am not full idiot who put vacuum on my table and start cleaning. However, okay - let it be.

    And for this I'll just say that it's nothing to be done on valetudo's side Cmon man, I think that can be done better. I mean I can see at least several things, that can be done from UX, starting just from removing path from you in case of manual stop and something like duplicate path detection using translate matrix comparison. I thought you guys can help here with issue, but looks like I addressing my question to wrong people, since Valetudo/ValetudoRE is just UI, and you have no information how this magic box works inside.

rand256 commented 4 years ago

do you start cleaning when the device stands on the dock? Yes. its obvious.

On the line above you wrote that you start full cleaning, stopped it and then run zoned cleaning. It is not obvious that the device was moved to the dock in between those actions.

Proper location? Yes, its again obvious. I am not full idiot who put vacuum on my table and start cleaning

This is what "proper position" about: Untitled See constrains. "Vacuum on the table", pfft.

since Valetudo/ValetudoRE is just UI

Exactly, glad you understand this.

These questions should be addressed to roborock software engineers, but to my experience their official support never answer meaningful things. Otherwise good luck trying to change logics inside compiled closed-source black box.

mvmaastricht commented 4 years ago

I recognise this behaviour, especially after I have let it clean up a different room, and put it back manually nearby it’s docking station to let it return to it. After that, I let it start an full cleaning for about 2 minutes, to let the robot reorient itself. It rotates or flips the map if:

To help the robot to better scan its position and persists in scanning the same orientation of the map every time, put the docking station to a place where it is relatively easy to see a glimpse of the proportions of the room.

I get the impression that a location not too far away from a corner in the room is helpful. But it’s also a hit or miss. Just experiment with changing the location.

pbassut commented 7 months ago

This happened to me after I changed the docker station location within the house. I guess I'll have to re-do the map?

fazer666 commented 6 months ago

It never happened when I used official firmware. Since I use Valetudo, it also happens to me some times (not every time). Actually, at the end of zone cleaning, when the robot goes back to home, it stops about 20cm in front of the docking station. So it doesn't charge. Then if I click on the home button (in Home assistant), the robot finishes his way to the dock. That's strange. I can't figure why sometimes the robot stops just a few centimeters before it reaches the docking station...