minor fixes

pull/2234/head
frederic wagner 2022-07-22 18:06:24 +02:00
parent f35967d502
commit 987a44990c
2 changed files with 11 additions and 9 deletions

View File

@ -2,10 +2,7 @@
* bugs * bugs
- meters seem to be a bit too long - meters seem to be a bit too long
- direction is still shitty on gps ? - direction is still shitty on gps ?
- we are always lost (done ?)
- waypoints seem wrong ?
* additional features * additional features

View File

@ -122,7 +122,7 @@ class Status {
this.path.point(segment), this.path.point(segment),
this.path.point(segment + 1) this.path.point(segment + 1)
); );
return distance_to_nearest > 20; return distance_to_nearest > 30;
} }
display() { display() {
g.clear(); g.clear();
@ -181,7 +181,7 @@ class Status {
(this.current_segment + 1) + (this.current_segment + 1) +
"/" + "/" +
(this.path.len - 1) + (this.path.len - 1) +
" " + " " +
this.distance_to_next_point + this.distance_to_next_point +
"m", "m",
0, 0,
@ -189,9 +189,11 @@ class Status {
); );
if (this.distance_to_next_point <= 20) { if (this.distance_to_next_point <= 20) {
g.setColor(0.0, 1.0, 0.0) if (this.path.is_waypoint(this.reaching)) {
.setFont("6x8:2") g.setColor(0.0, 1.0, 0.0)
.drawString("turn", g.getWidth() - 55, 35); .setFont("6x8:2")
.drawString("turn", g.getWidth() - 55, 35);
}
} }
if (!this.on_path) { if (!this.on_path) {
g.setColor(1.0, 0.0, 0.0) g.setColor(1.0, 0.0, 0.0)
@ -315,7 +317,10 @@ class Path {
} }
is_waypoint(point_index) { is_waypoint(point_index) {
return this.waypoints[Math.floor(point_index / 8)] & point_index % 8; let i = Math.floor(point_index / 8);
let subindex = point_index % 8;
let r = this.waypoints[i] & (1 << subindex);
return r != 0;
} }
// execute op on all segments. // execute op on all segments.