Cruisers Forum
 


Join CruisersForum Today

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

Join Date: Jul 2011
Posts: 3
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, 06:02   #2
Registered User

Join Date: Mar 2010
Location: QC, Canada
Boat: Kelt 8.50
Posts: 73
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 offline   Reply With Quote
Old 03-06-2013, 07:52   #3
Registered User

Join Date: Jul 2011
Posts: 3
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, 08:33   #4
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
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 offline   Reply With Quote
Old 03-06-2013, 08:38   #5
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
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 offline   Reply With Quote
Reply

Thread Tools
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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 04:48.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.