speedandcurrent 1.0.1 → 1.1.0
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/CHANGELOG.md +9 -1
- package/index.js +5 -13
- package/package.json +2 -2
- package/public/app.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
|
|
7
|
-
## [0.1
|
|
7
|
+
## [1.0.1] - 2025-1-27
|
|
8
8
|
### Added
|
|
9
9
|
- basic functionality to estimate speed, leeway and current using Kalman filters
|
|
10
10
|
- basic functionality for a webapp that shows what is going on
|
|
11
|
+
|
|
12
|
+
## [1.1.0] - 2025-8-20
|
|
13
|
+
### Changed
|
|
14
|
+
- Path names for current. It now is self.environment.current.setTrue and self.environment.current.drift
|
|
15
|
+
### Fixed
|
|
16
|
+
- Case error in filename that prevented the webapp from displaying the correction table
|
|
17
|
+
- Corrected speed through water is now calculated when the correction table is fixed
|
|
18
|
+
|
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ module.exports = function (app) {
|
|
|
12
12
|
let isRunning = false;
|
|
13
13
|
let corrTable = null;
|
|
14
14
|
let lastSave = null;
|
|
15
|
-
var residual, heading, attitude, boatSpeed, boatSpeedPolar, correctedBoatSpeed, groundSpeed, current,
|
|
15
|
+
var residual, heading, attitude, boatSpeed, boatSpeedPolar, correctedBoatSpeed, groundSpeed, current, speedCorrection, reporter;
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const plugin = {};
|
|
@@ -237,8 +237,7 @@ module.exports = function (app) {
|
|
|
237
237
|
attitude.subscribe(app, plugin.id, unsubscribes);
|
|
238
238
|
|
|
239
239
|
// current
|
|
240
|
-
|
|
241
|
-
current = new PolarDeltaBase();
|
|
240
|
+
current = new PolarDeltaBase("self.environment.current.drift","self.environment.current.setTrue");
|
|
242
241
|
current.setDisplayAttributes("current", "ref_ground", "current");
|
|
243
242
|
|
|
244
243
|
const currentStat = new PolarStat(current);
|
|
@@ -370,14 +369,8 @@ module.exports = function (app) {
|
|
|
370
369
|
|
|
371
370
|
|
|
372
371
|
// Send calculated delta's
|
|
373
|
-
if (options.estimateCurrent)
|
|
374
|
-
|
|
375
|
-
const c = current.getPValue();
|
|
376
|
-
const cc = { drift: current.speed, setTrue: current.angle, setMagnetic: (current.angle - variance.value + Math.PI) % (2 * Math.PI) - Math.PI };
|
|
377
|
-
currentDelta.setValue(cc);
|
|
378
|
-
DeltaBase.sendDeltas(app, plugin.id, [currentDelta]);
|
|
379
|
-
}
|
|
380
|
-
if (options.estimateBoatSpeed) PolarDeltaBase.sendDeltas(app, plugin.id, [correctedBoatSpeed]);
|
|
372
|
+
if (options.estimateCurrent) PolarDeltaBase.sendDeltas(app, plugin.id, [current]);
|
|
373
|
+
if (options.estimateBoatSpeed) PolarDeltaBase.sendDeltas(app, plugin.id, [correctedBoatSpeed]);
|
|
381
374
|
|
|
382
375
|
// Save correction table
|
|
383
376
|
// periodically
|
|
@@ -535,7 +528,7 @@ module.exports = function (app) {
|
|
|
535
528
|
// locked table
|
|
536
529
|
options.doStartFresh = false;
|
|
537
530
|
options.updateCorrectionTable = false;
|
|
538
|
-
options.estimateBoatSpeed =
|
|
531
|
+
options.estimateBoatSpeed = true;
|
|
539
532
|
options.assumeCurrent = true;
|
|
540
533
|
options.estimateCurrent = true;
|
|
541
534
|
options.currentStability = 2;
|
|
@@ -576,7 +569,6 @@ module.exports = function (app) {
|
|
|
576
569
|
correctedBoatSpeed = null;
|
|
577
570
|
groundSpeed = null;
|
|
578
571
|
current = null;
|
|
579
|
-
currentDelta = null;
|
|
580
572
|
speedCorrection = null;
|
|
581
573
|
reporter = null;
|
|
582
574
|
isRunning = false;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "speedandcurrent",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A plugin that automatically corrects boat speed and calculates current and leeway using sensor fusion.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
package/public/app.js
CHANGED