Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 18-04-2020, 12:34   #1
Registered User

Join Date: Jan 2013
Posts: 5
Plugin developing: Get current GPS position

Hello all!
I'm new developing a OpenCPN plugin. I have search for documentation but can't find the way of getting the current GPS position in a plugin. Any help?

Regards!
__________________

alejandroh is offline   Reply With Quote
Old 18-04-2020, 16:58   #2
Registered User
 
Warby12's Avatar

Join Date: Apr 2013
Location: Pacific Ocean
Boat: Wauquiez Amphitrite 43 Ketch
Posts: 359
Re: Plugin developing: Get current GPS position

Hi there, doesn't the "Dashboard" plugin help you with this? Maybe I'm misunderstanding you
__________________

Warby12 is offline   Reply With Quote
Old 18-04-2020, 17:06   #3
Registered User
 
Bill O's Avatar

Join Date: Jul 2015
Boat: Bruce Bingham Christina 49
Posts: 1,313
Re: Plugin developing: Get current GPS position

Quote:
Originally Posted by alejandroh View Post
Hello all!
I'm new developing a OpenCPN plugin. I have search for documentation but can't find the way of getting the current GPS position in a plugin. Any help?

Regards!

I guess I don't understand the issue. Do you have a device to receive GPS data?
Did you look at this page? https://opencpn.org/wiki/dokuwiki/do...rted:gps_setup
__________________
Bill O.
KB3YMH
https://phoenixketch.blogspot.com/
Bill O is offline   Reply With Quote
Old 18-04-2020, 17:12   #4
Registered User

Join Date: Mar 2011
Posts: 121
Re: Plugin developing: Get current GPS position

Two options that I know of.

Receiving NMEA events in which position, cog, sog etc. are returned.

Code:
int YourPlugin::Init(void) {
.....
return WANTS_NMEA_EVENTS;
}
....
void YourPlugin::SetPositionFix(PlugIn_Position_Fix &pfix) {
    double YourLatitude = pfix.Lat; 
    double YourLongitude = pfix.Lon;
}
or parsing NMEA Sentences (In this case using the NMEA183 classes used by OpenCPN)

Code:
int YourPlugin::Init(void) {
.....
return WANTS_NMEA_SENTENCES;
}
....
void YourPlugin::SetNMEASentence(wxString &sentence) {
    // Parse the received NMEA 183 sentence
    nmea183 << sentence;
    if (nmea183.PreParse()) {
        if (nmea183.LastSentenceIDReceived == _T("GLL")) {
         ......
Welcome to the world of OpenCPN Plugin development .
stevead is offline   Reply With Quote
Old 25-04-2020, 00:41   #5
Registered User

Join Date: Jan 2013
Posts: 5
Re: Plugin developing: Get current GPS position

Thanks a lot! Hope to contribute to the comunity soon.
alejandroh is offline   Reply With Quote
Reply

Tags
current, gps, plug

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get GPS Position Ben245 OpenCPN 41 22-05-2019 06:16
No GPS connected, but $ECRMC shows GPS Position? Dos OpenCPN 6 30-04-2019 15:06
Possible to get GPS position data from NMEA1083 into Seatalkng network? benzy Marine Electronics 7 29-05-2018 12:47
Ctrl + M = Drop Marker at Current GPS Position Algarve OpenCPN 1 05-02-2012 00:40

Advertise Here


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


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.