Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 03-06-2013, 02:30   #1
Registered User

Join Date: Jul 2011
Posts: 4
Technical: API to query heading(s)?

Hi,

I'd like to try to make my own auto pilot system by running an hydraulic pump from my opencpn computer via a high power USB DC motor controller.

Howevere I need to know if my 'autopilot' software can query opencpn for three parameters:
1. If a Route is active
2. The Current Vessel Heading in degrees
3. The heading from current position to the next waypoint (also in degrees).

Does it exist possibilities to retrieve these data / values from opencpn?

After having reached a waypoint I assume the heading to the next waypoint is immediately calculated, so I won't run into problems here :-)

Thanks a lot for comments on this 'project'

best regards Tor
bushtor is offline   Reply With Quote
Old 03-06-2013, 05:02   #2
Registered User

Join Date: Mar 2010
Location: QC, Canada
Boat: Kelt 8.50
Posts: 180
Re: Technical: API to query heading(s)?

Quote:
Originally Posted by bushtor View Post
Hi,

I'd like to try to make my own auto pilot system by running an hydraulic pump from my opencpn computer via a high power USB DC motor controller.

Howevere I need to know if my 'autopilot' software can query opencpn for three parameters:
1. If a Route is active
2. The Current Vessel Heading in degrees
3. The heading from current position to the next waypoint (also in degrees).

Does it exist possibilities to retrieve these data / values from opencpn?

After having reached a waypoint I assume the heading to the next waypoint is immediately calculated, so I won't run into problems here :-)

Thanks a lot for comments on this 'project'

best regards Tor
Thor

The information you are looking for is available. You cannot query it, but it is sent periodically by OpenCPN

1 it is available only if a route is active.
2 Heading is available from the RMC NMEA sentence
3 Bearing to next waypoint is available from the RMB NMEA sentence

Your autopilot could receive that information via a serial port or a network connection.

Search the help file for RMB, RMC and Autopilots

Jean-Marie
houlejm is online now   Reply With Quote
Old 03-06-2013, 06:52   #3
Registered User

Join Date: Jul 2011
Posts: 4
Re: Technical: API to query heading(s)?

Thanks for the comment. I knew it probably was available in the NMEA stream, but as I stated I will run my autopilot software off *the same computer* as opencpn runs, hence I asked for some API or other 'query' methods...

I assume that I cannot 'wiretap' with software an outgoing serial or ethernet stream on the same computer...?

Btw, are there anyone else here who has written their own autopilot software and connected it to opencpn?

regards Tor
bushtor is offline   Reply With Quote
Old 03-06-2013, 07:33   #4
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,387
Re: Technical: API to query heading(s)?

tor....

two ways to go:

1. Build a PlugIn for OpenCPN. All the information you require is available at the PlugIn API.

or...

2. Build a standalone app that reads UDP NMEA datastream sent from OpenCPN. Again, all the the required data is available on the UDP stream.

Good Luck
Dave
bdbcat is online now   Reply With Quote
Old 03-06-2013, 07:38   #5
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,198
Re: Technical: API to query heading(s)?

bushtor...
Of course you could, but you don't have to - the NMEA stream is a available in the plugin API, study https://github.com/OpenCPN/OpenCPN/b.../ocpn_plugin.h and https://github.com/OpenCPN/OpenCPN/b...ginmanager.cpp. As for route activation, I will be merging some stuff from Konni into the messaging part of the API soon that will do exactly that.
Rememmber that the API is basically event based, not request-response - good thing for overall performance, so at least I will be pretty reluctant to support any changes there.

Pavel
nohal is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here


All times are GMT -7. The time now is 07:21.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.