gipy: waypoints magic

master
frederic wagner 2023-10-05 14:52:18 +02:00
parent 539d687fd8
commit ab8d103a8b
9 changed files with 40 additions and 24 deletions

View File

@ -114,4 +114,10 @@
* Better position in elevation profiles
* Integrating fixes in upstream rust heatshrink crate
* Small path optimisations with brouter (removing looplets)
* Bugfix in nearest segment detection
* Bugfix in nearest segment detection
0.23:
* Better path simplification
* Waypoints autodetection using the map
* New option: sleep between waypoints
* Removed sharp turns auto-detection

View File

@ -18,7 +18,6 @@ It provides the following features :
- display the path with current position from gps
- display a local map around you, downloaded from openstreetmap
- detects and buzzes if you leave the path
- (optional) buzzes before sharp turns
- (optional) buzzes before waypoints
(for example when you need to turn in https://mapstogpx.com/)
- display instant / average speed
@ -122,6 +121,7 @@ Few settings for now (feel free to suggest me more) :
- power lcd off (disabled by default): turn lcd off when inactive to save power. the watch will wake up when reaching points,
when you touch the screen and when speed is below 13km/h.
- powersave by default: when gipy starts is powersaving activated ? (see below)
- sleep between waypoints: instead of powersaving between points save power between waypoints (crossroads). this way you can save more. waypoints autodetection is WIP.
### Powersaving
@ -142,7 +142,7 @@ The algorithm works in the following ways :
Activation events are the following :
- you are near (< 100m) the next point on path
- you are near (< 100m) the next point (only waypoints of *sleep between waypoints* is on) on path
- you are slow (< *wake-up speed* setting (13 km/h by default))
- you are lost
- you press the button / touch the screen

View File

@ -31,9 +31,10 @@ var settings = Object.assign(
active_time: 10,
brightness: 0.5,
buzz_on_turns: false,
disable_bluetooth: true,
disable_bluetooth: false,
power_lcd_off: false,
powersave_by_default: false,
sleep_between_waypoints: false,
},
s.readJSON("gipy.json", true) || {}
);
@ -877,14 +878,15 @@ class Status {
// }, time_to_next_point);
// }
// }
let reaching_waypoint = this.path.is_waypoint(next_point);
if (this.distance_to_next_point <= 100) {
this.activate();
}
if (this.reaching != next_point && this.distance_to_next_point <= 100) {
this.reaching = next_point;
let reaching_waypoint = this.path.is_waypoint(next_point);
if (reaching_waypoint) {
if (settings.buzz_on_turns) {
if (reaching_waypoint || !settings.sleep_between_waypoints) {
this.activate();
}
if (this.reaching != next_point) {
this.reaching = next_point;
if (reaching_waypoint && settings.buzz_on_turns) {
Bangle.buzz();
setTimeout(() => Bangle.buzz(), 500);
setTimeout(() => Bangle.buzz(), 1000);

View File

@ -2,7 +2,7 @@
"id": "gipy",
"name": "Gipy",
"shortName": "Gipy",
"version": "0.22",
"version": "0.23",
"description": "Follow gpx files using the gps. Don't get lost in your bike trips and hikes.",
"allow_emulator":false,
"icon": "gipy.png",

View File

@ -73,11 +73,11 @@ export interface InitOutput {
readonly __wbindgen_malloc: (a: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9f56e5d7ebbfdb61: (a: number, b: number, c: number) => void;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7bd03fc857623879: (a: number, b: number, c: number) => void;
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_free: (a: number, b: number) => void;
readonly __wbindgen_exn_store: (a: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h193105c6f054446a: (a: number, b: number, c: number, d: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h743e956546cf34aa: (a: number, b: number, c: number, d: number) => void;
}
export type SyncInitInput = BufferSource | WebAssembly.Module;

View File

@ -205,7 +205,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
return real;
}
function __wbg_adapter_24(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9f56e5d7ebbfdb61(arg0, arg1, addHeapObject(arg2));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7bd03fc857623879(arg0, arg1, addHeapObject(arg2));
}
function _assertClass(instance, klass) {
@ -379,7 +379,7 @@ function handleError(f, args) {
}
}
function __wbg_adapter_85(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h193105c6f054446a(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
wasm.wasm_bindgen__convert__closures__invoke2_mut__h743e956546cf34aa(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}
/**
@ -440,9 +440,6 @@ async function load(module, imports) {
function getImports() {
const imports = {};
imports.wbg = {};
imports.wbg.__wbg_log_d04343b58be82b0f = function(arg0, arg1) {
console.log(getStringFromWasm0(arg0, arg1));
};
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
@ -451,6 +448,9 @@ function getImports() {
getInt32Memory0()[arg0 / 4 + 1] = len0;
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
};
imports.wbg.__wbg_log_d04343b58be82b0f = function(arg0, arg1) {
console.log(getStringFromWasm0(arg0, arg1));
};
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
};
@ -685,8 +685,8 @@ function getImports() {
const ret = wasm.memory;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper2230 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 264, __wbg_adapter_24);
imports.wbg.__wbindgen_closure_wrapper2268 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_24);
return addHeapObject(ret);
};

Binary file not shown.

View File

@ -13,8 +13,8 @@ export function gps_from_area(a: number, b: number, c: number, d: number): numbe
export function __wbindgen_malloc(a: number): number;
export function __wbindgen_realloc(a: number, b: number, c: number): number;
export const __wbindgen_export_2: WebAssembly.Table;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9f56e5d7ebbfdb61(a: number, b: number, c: number): void;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7bd03fc857623879(a: number, b: number, c: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;
export function __wbindgen_free(a: number, b: number): void;
export function __wbindgen_exn_store(a: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h193105c6f054446a(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h743e956546cf34aa(a: number, b: number, c: number, d: number): void;

View File

@ -6,10 +6,11 @@
wake_up_speed: 13,
active_time: 10,
buzz_on_turns: false,
disable_bluetooth: true,
disable_bluetooth: false,
brightness: 0.5,
power_lcd_off: false,
powersave_by_default: false,
sleep_between_waypoints: false,
},
require("Storage").readJSON(FILE, true) || {}
);
@ -89,6 +90,13 @@
settings.powersave_by_default = v;
writeSettings();
}
},
"sleep between waypoints": {
value: settings.sleep_between_waypoints == true,
onchange: (v) => {
settings.sleep_between_waypoints = v;
writeSettings();
}
}
});
});