Skip to content

Commit

Permalink
Fix RMB no position handling.
Browse files Browse the repository at this point in the history
Send delta with nextPoint.position value = null
  • Loading branch information
panaaj committed Jun 7, 2024
1 parent 6c3351c commit 2466737
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hooks/RMB.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const utils = require('@signalk/nmea0183-utilities')
const moment = require('moment-timezone')

/*
RMC Sentence
RMB Sentence
$GPRMB,A,0.66,L,003,004,4917.24,N,12309.57,W,001.3,052.5,000.5,V*20
values:
Expand Down Expand Up @@ -49,11 +49,17 @@ module.exports = function (input) {
let vmg = 0.0
let distance = 0.0
let crossTrackError = 0.0
let position = null

latitude = utils.coordinate(parts[5], parts[6])
longitude = utils.coordinate(parts[7], parts[8])
if (isNaN(latitude) || isNaN(longitude)) {
return null
position = null
} else {
position = {
longitude,
latitude
}
}

bearing = utils.float(parts[10])
Expand All @@ -78,10 +84,7 @@ module.exports = function (input) {
values: [
{
path: 'navigation.courseRhumbline.nextPoint.position',
value: {
longitude,
latitude,
},
value: position,
},

{
Expand Down

0 comments on commit 2466737

Please sign in to comment.