signalk-racer 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Signal K Racing Plugin
2
2
 
3
- This PROTOTYPPE plugin adds sail racing-relevant data calculations to a Signal K server. It focuses on real-time information useful during the start of a race, such as distance to the line, start line bias, and geographic position of the line ends.
3
+ This PROTOTYPE plugin adds sail racing-relevant data calculations to a Signal K server. It focuses on real-time information useful during the start of a race, such as distance to the line, start line bias, and geographic position of the line ends.
4
4
 
5
5
  GitHub repository: [https://github.com/gregw/signalk-racer](https://github.com/gregw/signalk-racer)
6
6
 
@@ -10,17 +10,19 @@ GitHub repository: [https://github.com/gregw/signalk-racer](https://github.com/g
10
10
 
11
11
  This plugin calculates and publishes the following Signal K paths:
12
12
 
13
- | Path | Description | Units | Schema |
14
- |---------------------------------------------|---------------------------------------------------------|---------|--------|
15
- | `navigation.racing.`<br/>`distanceStartline` | Signed minimum distance from the bow to the start line | `m` | Y |
16
- | `navigation.racing.`<br/>`startLineLength` | Total length of the start line | `m` | |
17
- | `navigation.racing.`<br/>`stbLineBias` | Bias of the start line toward the starboard end | `m` | |
18
- | `navigation.racing.`<br/>`startLinePort.latitude` | Latitude of the port (pin) end of the start line | `deg` | Y |
19
- | `navigation.racing.`<br/>`startLinePort.longitude` | Longitude of the port (pin) end of the start line | `deg` | Y |
20
- | `navigation.racing.`<br/>`startLineStb.latitude` | Latitude of the starboard (boat) end of the start line | `deg` | Y |
21
- | `navigation.racing.`<br/>`startLineStb.longitude` | Longitude of the starboard (boat) end of the start line | `deg` | Y |
22
- | `navigation.racing.`<br/>`nextLegHeading` | True heading for the next leg of the course | `deg` | |
23
- | `navigation.racing.`<br/>`nextLegTWA` | True Wind Angle for the next leg of the course | `deg` | |
13
+ | Path | Description | Units | Std |
14
+ |----------------------------------------------------|---------------------------------------------------------|-------|-----|
15
+ | `navigation.racing.`<br/>`distanceStartline` | Signed minimum distance from the bow to the start line | `m` | Y |
16
+ | `navigation.racing.`<br/>`startLineLength` | Total length of the start line | `m` | |
17
+ | `navigation.racing.`<br/>`stbLineBias` | Bias of the start line toward the starboard end | `m` | |
18
+ | `navigation.racing.`<br/>`startLinePort.latitude` | Latitude of the port (pin) end of the start line | `deg` | Y |
19
+ | `navigation.racing.`<br/>`startLinePort.longitude` | Longitude of the port (pin) end of the start line | `deg` | Y |
20
+ | `navigation.racing.`<br/>`startLineStb.latitude` | Latitude of the starboard (boat) end of the start line | `deg` | Y |
21
+ | `navigation.racing.`<br/>`startLineStb.longitude` | Longitude of the starboard (boat) end of the start line | `deg` | Y |
22
+ | `navigation.racing.`<br/>`nextLegHeading` | True heading for the next leg of the course | `deg` | |
23
+ | `navigation.racing.`<br/>`nextLegTWA` | True Wind Angle for the next leg of the course | `deg` | |
24
+ | `navigation.racing.`<br/>`timeToStart` | Period of time until the race start | `s` | Y |
25
+ | `navigation.racing.`<br/>`startTime` | The start time as an ISO timestamp | `iso` | |
24
26
 
25
27
  These values can be displayed in KIP, Freeboard-SK, or other Signal K clients.
26
28
 
@@ -28,18 +30,17 @@ These values can be displayed in KIP, Freeboard-SK, or other Signal K clients.
28
30
 
29
31
  ---
30
32
 
31
-
32
33
  ## ⚙️ Configuration
33
34
 
34
35
  You can configure the plugin via the Signal K web interface or by editing `settings.json` manually.
35
36
 
36
37
  ### Parameters:
37
38
 
38
- | Parameter | Description | Default |
39
- |--------------------|---------------------------------------------------------------------------------------|---------------|
40
- | `startLineStb` | Name of the waypoint for the starboard (committee boat) end of the line | `"startBoat"` |
41
- | `startLinePort` | Name of the waypoint for the port (pin) end of the line | `"startPin"` |
42
- | `period` | How often to update values (in milliseconds) | `1000` |
39
+ | Parameter | Description | Default |
40
+ |----------------|--------------------------------------------------------------------------|---------------|
41
+ | `startLineStb` | Name of the waypoint for the starboard (committee boat) end of the line | `"startBoat"` |
42
+ | `startLinePort` | Name of the waypoint for the port (pin) end of the line | `"startPin"` |
43
+ | `period` | How often to update values (in milliseconds) | `1000` |
43
44
 
44
45
  ---
45
46
 
@@ -83,26 +84,48 @@ If `navigation.headingTrue` is not available, then `navigation.courseOverGroundT
83
84
 
84
85
  ---
85
86
 
86
- ## 🌐 Start Line REST API
87
+ ## 🌐 API Access
88
+
89
+ This plugin uses WebSocket-based PUT requests to Signal K model paths.
90
+
91
+ ### `navigation.racing.setStartLine`
87
92
 
88
- The plugin provides a REST API that allows external clients (e.g. KIP dashboards, mobile apps, or scripts) to **set or query the start line ends**. This can be used to "ping" the boat or pin end by calling a simple HTTP POST with or without a position.
93
+ Used to **set** or **adjust** either end of the start line.
89
94
 
90
- The plugin supports **partial line configuration**: you can set just one end (port or starboard), and it will store and emit that end's position immediately. Once both ends are defined, the full line geometry (length, bearing, bias) will be calculated.
95
+ #### Payload:
96
+ ```json
97
+ {
98
+ "end": "port" | "stb",
99
+ "position": "bow" | { "latitude": ..., "longitude": ... },
100
+ "delta": 10,
101
+ "rotate": 0.1
102
+ }
103
+ ```
91
104
 
92
- ### 📮 API Endpoints
105
+ - `end`: which end to modify.
106
+ - `position`: `"bow"` or `{ latitude, longitude }`.
107
+ - `delta`: distance in meters along bearing.
108
+ - `rotate`: angle in radians.
109
+
110
+ ---
93
111
 
94
- | Method | Endpoint | Description |
95
- |--------|-----------------------------------------|------------------------------------------------------------------------------------------------------|
96
- | `GET` | `/plugins/signalk-racer/startline/port` | Get the last known **port (pin)** end position |
97
- | `PUT` | `/plugins/signalk-racer/startline/port` | Set the **port (pin)** end of the start line to the current position of the boat plus the bow offset |
98
- | `GET` | `/plugins/signalk-racer/startline/stb` | Get the last known **starboard (boat)** end position |
99
- | `PUT` | `/plugins/signalk-racer/startline/stb` | Set the **starboard (boat)** end of the line to the current position of the boat plus the bow offset |
100
- | `PUT` | `/plugins/signalk-racer/timeToStart` | Set the **timeToStart** in seconds and receive the current **distanceToLine** |
112
+ ### `navigation.racing.setStartTime`
101
113
 
114
+ Used to **start**, **sync**, **reset**, or **set a fixed start time**.
115
+
116
+ #### Payload:
117
+ ```json
118
+ {
119
+ "command": "start" | "reset" | "sync" | "adjust" | "set",
120
+ "delta": 30,
121
+ "startTime": "2025-06-18T04:15:00Z"
122
+ }
123
+ ```
124
+ ---
102
125
 
103
126
  ## 🔄 Dependencies
104
127
 
105
- - [geolib](https://github.com/manuelbieh/geolib): Used for all geospatial math, including distances, bearings, and projections.
128
+ - `geolib`: for distance and bearing calculations.
106
129
 
107
130
  ---
108
131
 
@@ -111,11 +134,10 @@ The plugin supports **partial line configuration**: you can set just one end (po
111
134
  - Add calculations for:
112
135
  - **Time to line** (using STW and heading or polar speeds)
113
136
  - **Laylines** and distance/time to them
114
- - Include webapp UI for on-deck ease of "pinging" the line
137
+ - A KIP widget as well as the webapp.
115
138
  - Better integration with **Freeboard-SK** and **KIP** dashboards
116
139
 
117
- ---
118
-
140
+ ---
119
141
  ## 📬 Feedback
120
142
 
121
143
  Bug reports and suggestions are welcome at
package/ReleaseNotes.md CHANGED
@@ -8,4 +8,11 @@
8
8
  ## 0.9.3 KIP racer-timer integration
9
9
  + added timeToStart API
10
10
  ## 0.9.4 Trivial rename
11
- + Renamed README.md for npmjs
11
+ + Renamed README.md for npmjs
12
+ ## 0.9.5 Restructured
13
+ + Restructured the plugin to avoid initialization problem in new server
14
+ ## 0.9.6 V2 API and Timer
15
+ + Added new API V2 methods
16
+ + Removed V1 methods
17
+ + Webapp uses websocket
18
+ + Server side timer