rand256 / valetudo

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

Missing rotate option in valetudo-mapper breaks calibration point generation #488

Closed maximweb closed 1 year ago

maximweb commented 1 year ago

Describe the bug As discussed https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/discussions/435#discussioncomment-3399005, the valetudo-mapper appears to return nan/null values for the calibration point vacuum coordinates when rotate option is unset.

How to Reproduce Remove rotate option from config.

Possible Fix Can't test right now, but I believe the rotate option has no default value but if omitted remains unset. Yet, during calibration point calculation it is used without checking.

[https://github.com/rand256/valetudo-mapper/blob/master/lib/Tools.js#L351-L369](This part) may be the issue. Maybe something like

if(parseInt(settings.rotate) {
    alpha = ...
} else {
    alpha = 0
}

Could fix the issue.

rand256 commented 1 year ago

Should be fixed now.