signalk-course-autoadvance
v0.2.0
Published
Server-side, client-independent auto-advance of the active route waypoint on arrival-circle entry or perpendicular-passage, driven by @signalk/course-provider notifications.
Maintainers
Readme
signalk-course-autoadvance
Server-side, client-independent auto-advance of the active route waypoint.
@signalk/course-provider
already computes arrival-circle entry and perpendicular-passage crossing and
emits them as notifications.navigation.course.arrivalCircleEntered /
...perpendicularPassed. Nothing acts on those notifications unless a
specific UI client (e.g. Freeboard-SK) happens to be open, connected, and
configured to react to them - which makes route progression for any
SignalK-course-API-driven autopilot setup depend on optional UI state.
This plugin watches the same notifications and advances the active route
itself, independent of any browser client, network uplink, or which (if any)
chart-plotter app is open. Requires @signalk/course-provider to be
installed and running - it relies on course-provider's notifications, it
does not duplicate the underlying geometry.
Configuration
Enable and configure under Server > Plugin Config > Course Auto-Advance.
| Setting | Description | Default |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| Enable auto-advance | Master on/off switch. Disabled by default. | false |
| Advance on | arrivalCircleEntered or perpendicularPassed | arrivalCircleEntered |
| Delay before advancing (ms) | Grace period after the trigger fires, in case the vessel exits the trigger condition again before advancing (e.g. GPS jitter at the circle boundary). | 5000 |
| Clear destination on reaching the last waypoint | On the final point of the active route, clear the destination instead of advancing (advancing would just re-target the same last point). | true |
Known limitation
Advancing is done via the plugin-facing app.activateRoute(), which is the
same method used to start a route from scratch - there is no narrower
plugin-facing method for "advance the route already active by one point"
(that logic exists only inline inside signalk-server's
PUT .../activeRoute/nextPoint Express route, with no method backing it for
plugins to call without an authenticated HTTP request). Consequence: every
auto-advance resets navigation.course.startTime ("time navigation
commenced") to the current time. Harmless today - nothing in course-provider
or Freeboard-SK reads that field - but worth knowing if you build something
that does.
Development
npm install
npm run typecheck # tsc --noEmit over src + test, every strict flag
npm run build # compile src/ -> dist/ (the published artifact)
npm test # behavior + plugin/package shape checks, run via tsx against src/
npm run lint
npm run format:checkSee Justfile for the full check/publish workflow (just check, just publish).
