diff --git a/TODO.adoc b/TODO.adoc index 63c7357..671babc 100644 --- a/TODO.adoc +++ b/TODO.adoc @@ -334,6 +334,11 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho the car server's trip and position (`/api/trip`, `/api/gnss/position`); only the map and the next maneuver, planning stays on the web. Testable without the car: the tablet runs the Android Auto head unit emulation (DHU) +*** [ ] Views by who's driving off which screen: no Android Auto connected → the 16" display + shows the 3D follow view (heading-up, pitched) for the driver; Android Auto connected → it + streams the 3D navigation to the driver, and the co-driver's display stays 2D (north-up + overview, planning). Needs the app to report connected/disconnected to the server (e.g. + next to `/api/gnss/position`) and the driving view to switch on it ** [ ] A native Android app on Ferrostar (rerouting, Valhalla speed limits, TTS built in) over our Valhalla (`format: osrm`) — only if navigation is wanted on a phone outside the car; the car's 16" display is the Pi's browser either way. Ferrostar's web components are beta: no diff --git a/public/js/gnss.js b/public/js/gnss.js index dd46d6b..03fb1b3 100644 --- a/public/js/gnss.js +++ b/public/js/gnss.js @@ -74,7 +74,7 @@ export function resumeFollow(map) { // The first step of a follow (or a jump after a gap): zoom in to see the // road ahead. easeTo, not flyTo — flyTo's swoop zooms out over the distance // first, the wrong way when starting to drive. -export const FOLLOW_ZOOM = 16; +export const FOLLOW_ZOOM = 17; export function startFollow(map, lngLat) { map.easeTo({ center: lngLat, zoom: Math.max(map.getZoom(), FOLLOW_ZOOM), duration: 1000 }); } @@ -102,11 +102,11 @@ export function followPosition(map, lngLat, heading, speed, duration) { } // Auto-zoom like a car navigation: close in town, farther out the faster -// (0 km/h z17, 50 z16.2, 90 z15.6, 130+ z15). Eased toward that by at most +// (up to 20 km/h z18, 50 z17.3, 90 z16.3, 120+ z15.6). Eased toward that by at most // 0.15 a fix and ignored within 0.25, so speed jitter doesn't pump the map. // A hand zoom pauses the follow; on resuming it eases back. export function autoZoom(current, speed) { - const target = Math.min(17, Math.max(15, 17 - speed * 3.6 * 0.0154)); + const target = Math.max(15.5, 18 - Math.max(0, speed * 3.6 - 20) * 0.024); const diff = target - current; if (Math.abs(diff) < 0.25) return null; return current + Math.sign(diff) * Math.min(Math.abs(diff), 0.15);