This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Signal K data parsing
#1
I am running OP2.5, have a GPS puck set up and have OpenCPN setup to send APB and RMB data back to signal K.  

I see many Signal K phrases parsed from the NMEA0183 RMB sentence (items 2, 6-12 from the list below), but I dont see one for Steer direction (item 3).  this component is also not parsed from APB.  what decides which parts of which sentences are parsed and How would I go about extracting that data?

RMB - Recommended Minimum Navigation Information[url=https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:advanced_features:nmea_sentences#rmb_-_recommended_minimum_navigation_information][/url]
To be sent by a navigation receiver when a destination waypoint is active.
''
                                                           14
       1 2   3 4    5    6       7 8        9 10  11  12  13|  15
       | |   | |    |    |       | |        | |   |   |   | |   |
$--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A,m,*hh<CR><LF>''

Field Number:
  1. Status, A= Active, V = Void
  2. Cross Track error - nautical miles
  3. Direction to Steer, Left or Right
  4. TO Waypoint ID
  5. FROM Waypoint ID
  6. Destination Waypoint Latitude
  7. N or S
  8. Destination Waypoint Longitude
  9. E or W
  10. Range to destination in nautical miles
  11. Bearing to destination in degrees True
  12. Destination closing velocity in knots
  13. Arrival Status, A = Arrival Circle Entered
  14. Status A - Data Valid, V - Data Invalid, FAA mode indicator (NMEA 2.3 and later)
I would also be interested in calculating the ETA to next waypoint (/vessels/<RegExp>/navigation/courseRhumbline/activeRoute/estimatedTimeOfArrival) and the steer error (to go along with the Left or right steer direction)

ultimately, I would also like to calculate tidal drift using COG and GPS speed, vs heading and boat speed to be able to correct for the drift (corrected bearing to waypoint)

Thanks
Jason
Reply
#2
https://github.com/SignalK/nmea0183-sign...ster/hooks

https://github.com/SignalK/signalk-derived-data
Reply
#3
(2020-11-18, 10:43 PM)tkurki Wrote: https://github.com/SignalK/nmea0183-sign...ster/hooks

https://github.com/SignalK/signalk-derived-data
Thanks!

So I took a look at the nmea0183-signalk APB.js file and saw that 'direction' was already used in another phrase

Code:
 const direction = parts[3].trim().toUpperCase() === 'L' ? 1 : -1
 
but this would set L = 1 and R = -1, interesting

but I might need L and R
Code:
 // Direction to Steer
 const directionToSteer = parts[3].trim().toUpperCase() === 'L' ? "L" : "R"

I couldn't find a phrase for steer direction in the SignalK Documentation so I created one - not sure if this is OK?

Code:
         {
           path: 'steering.autopilot.target.direction',
           value: directionToSteer
         },
         {
           path: 'steering.autopilot.target.dirnum',
           value: direction
         },

and as such I have these two phrases ...direction and ...dirnum (direction number - not great) in signal K

   

I have attached the "APB.js" as a text file, just needs renaming, if anybody else wants to use it or make it available elsewhere?

I will work on adding the other items into Derived data


Attached Files
.txt   APB.txt (Size: 5.18 KB / Downloads: 4)
Reply
#4
It may be I don't understand your goals with this but bear in mind you still have the origin "Direction to steer" flag in your changed APB. That's a negative XTE ('navigation.courseRhumbline.crossTrackError') value if direction is right and positive if left.
Reply
#5
Thanks, didn’t think of that. I want to set up a simple page that has a sail gauge and then shows you how many degrees you need to steer right or left so I intend to setup two parameters that are steerErrorLeft and steerErrorRight and then have them displayed to the left and right of the page a keep the helmsman on course during racing. I could have done that by checking if the XTE was positive or negative
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)