Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 20-09-2011, 14:01   #1
Registered User

Join Date: Feb 2010
Posts: 619
Route Planning with GRIB - Work in Progress

I have added a Wind Column to the Route Properties Dialog. Given some starting time, this lists forecast wind direction and speed for all waypoints against the GRIB displayed on screen.

For the moment I use only a single, manually selected GribRecordSet, and I do not set next leg speed from the forecast/polar diagram yet. This should not be too difficult, but first I would like to settle the Plugin interface, which seems the hardest part.

I took an earlier Forums - Post 639485">-IRJDSUNE9932123321222xxeww-advice, and extended the set of optional plugin methods to pass a "double" value together with a well-known-identifier. It may go to all plugins, and an answer is expected from some plugin (first answer offered is accepted and sufficient). I imagine that in the future there might also be a method to gather responses from all participating plugins, but I have no need for this now.

I attach the (surprisingly small) working patch based on 2.5.0. I'd appreciate very much any comments and further advice (or maybe the definitive source for the interface to exchange data with plugins...). This is a trial, working version, so I do not split this now into Plugin Protocol Patch and GRIB Route Planning Patch - it is clear what file does what, I think. I have tentatively given some numbering to API versions etc. just to keep the visible difference from base release.

Many thanks in advance for hints.

Piotr
Attached Thumbnails
Click image for larger version

Name:	grib_route_sample.jpg
Views:	715
Size:	202.7 KB
ID:	31855  
Attached Files
File Type: doc 0001-add-wind-column-to-routeprop.patch.doc (18.1 KB, 361 views)
__________________

__________________
PjotrC is offline   Reply With Quote
Old 20-09-2011, 15:01   #2
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Re: Route Planning with GRIB - Work in Progress

Quote:
Originally Posted by PjotrC View Post
I have added a Wind Column to the Route Properties Dialog. Given some starting time, this lists forecast wind direction and speed for all waypoints against the GRIB displayed on screen.

For the moment I use only a single, manually selected GribRecordSet, and I do not set next leg speed from the forecast/polar diagram yet. This should not be too difficult, but first I would like to settle the Plugin interface, which seems the hardest part.

I took an earlier Forums - Post 639485">-IRJDSUNE9932123321222xxeww-advice, and extended the set of optional plugin methods to pass a "double" value together with a well-known-identifier. It may go to all plugins, and an answer is expected from some plugin (first answer offered is accepted and sufficient). I imagine that in the future there might also be a method to gather responses from all participating plugins, but I have no need for this now.

I attach the (surprisingly small) working patch based on 2.5.0. I'd appreciate very much any comments and further advice (or maybe the definitive source for the interface to exchange data with plugins...). This is a trial, working version, so I do not split this now into Plugin Protocol Patch and GRIB Route Planning Patch - it is clear what file does what, I think. I have tentatively given some numbering to API versions etc. just to keep the visible difference from base release.

Many thanks in advance for hints.

Piotr
Nice work Piotr.
The patch applied cleanly. No problem compiling but an immediate crash on start, with the following debug back trace
Click image for larger version

Name:	mine3.png
Views:	270
Size:	6.1 KB
ID:	31856
(K)ubuntu 11.10 64 bits.
Thomas
__________________

__________________
cagney is offline   Reply With Quote
Old 20-09-2011, 15:35   #3
Registered User

Join Date: Feb 2010
Posts: 619
Re: Route Planning with GRIB - Work in Progress

Quote:
Originally Posted by cagney View Post
No problem compiling but an immediate crash on start,
(K)ubuntu 11.10 64 bits.
Works on my Vista, and I have no other platform for development... reminds me of the initial runs, where I got crashes when just changing the Minor version number for API/Plugin... this may still be wrong here. Might be better not to touch 'em...

With this post I would perhaps like to invite comments and suggestions on the protocol, rather than actual run-testing (which does bring some feedback, too ), if possible. The functionality will become meaningful only when the GRIB Record Set will be selected automatically according to computed ETA. Not far away...

Thanks,

Piotr
__________________
PjotrC is offline   Reply With Quote
Old 21-09-2011, 05:42   #4
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 300
Re: Route Planning with GRIB - Work in Progress

Hoi Pjotr,
I'm trying at the moment to make a new port from Zygrib 5.05 to OCPN plugin. I believe the Grib Record definition is slightly changed, but not to much. It will include for sure interpolating routines, to find a wind dir and speed at a given position and time.
Dirk
__________________
rooiedirk is offline   Reply With Quote
Old 21-09-2011, 11:01   #5
Registered User

Join Date: Feb 2010
Posts: 619
Re: Route Planning with GRIB - Work in Progress

Quote:
Originally Posted by rooiedirk View Post
Hoi Pjotr,
I'm trying at the moment to make a new port from Zygrib 5.05 to OCPN plugin. I believe the Grib Record definition is slightly changed, but not to much. It will include for sure interpolating routines, to find a wind dir and speed at a given position and time.
Dirk
Great news.
How are you going to make this data available to the main program?
__________________
PjotrC is offline   Reply With Quote
Old 21-09-2011, 13:03   #6
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 300
Re: Route Planning with GRIB - Work in Progress

No idea yet,
Apart from the current version there should be an option to have it run in background.
I already intend to have it automatic load the newest file from the GRIB directonary.
As far as I see the current plugin API has no option to transfer things like GRIB Records.
Any suggestions ?
Dirk
__________________
rooiedirk is offline   Reply With Quote
Old 21-09-2011, 14:24   #7
Registered User

Join Date: Mar 2009
Posts: 83
Re: Route Planning with GRIB - Work in Progress

The integration of Zygrib via a plug-in into OPCN is a great idea and I for one would support this as the best method for getting grib info into OPCN.

Zygrib is probably the best open source grib file viewer available (correct me if I am wrong here) and has a large number of people who are continuously updating and improving it.

I hope Rooledirk can overcome the technical difficulties to achieve this.
__________________
dougwm10 is offline   Reply With Quote
Old 21-09-2011, 14:30   #8
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Route Planning with GRIB - Work in Progress

Let me know when you have a Windows Vista compiled version available for testing.
I am also on Vista.

In the meantime I am using the OCPN 'Additional information' box with a link to Ugrib.

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_02 Sep. 21 17.32.jpg
Views:	401
Size:	215.7 KB
ID:	31890  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 26-09-2011, 10:24   #9
Registered User

Join Date: Feb 2010
Posts: 619
Re: Route Planning with GRIB - Work in Progress

I think we can test now all intended functionality under Windows... I will try to address the plugin interface issues separately.

The user manual is very simple:

If a GRIB dialog is open on screen, the Route Properties will display the (interpolated) wind forecast for each waypoint at its proper ETA
- if it is geographically within the currently displayed GRIB area
- and if it is no more than 24 hours from the nearest GRIB record set within the file

Only one GRIB _File_ at a time is considered (the one that the user has chosen manually by selecting to display one of its _Records_).

The leg speed for next route leg, and its corresponding ETA, will be estimated from a Polar Curve Set (if provided by user).

One simple way of providing the Polars is via opencpn.ini file:

Code:
.....
CM93DisplayOffsetEnable=0
PolarCurve0="00 00.0 4.0 40.0 4.0 60.0 4.0 65.0 4.0 90.0 4.0 130.0 4.0 160.0 4.0 180.0 4.0"
PolarCurve1="10 00.0 1.5 40.0 2.5 60.0 4.0 65.0 4.5 90.0 5.0 130.0 5.5 160.0 5.7 180.0 5.0"
PolarCurve2="32 00.0 0.5 40.0 1.5 60.0 6.5 65.0 7.0 90.0 8.0 130.0 8.5 160.0 8.7 180.0 8.0"
[Settings/GlobalState]
OwnShipLatLon="   58.9985,   -13.4471"
bFollow=0
nColorScheme=1
FrameWinX=1253
...
The above example set contains 3 Curves, for wind speeds 0 kts, 10 kts and 32 kts, respectively. I expect them in increasing order of wind speeds, and increasing angles of point-of-sail.

3 is the maximum number OCPN will take from its .ini file; there can be 3, 2, 1 or none of these present in the opencpn.ini.

The leg speed estimation algorithm will pick - for the given situation - (1) the closest curve, and then (2) the closest point within the curve. This means that Curve 0 is for winds 0-4 kts, Curve 1: 5-21 kts, and Curve 3: 22 kts and more. No interpolation is done dynamically, so if more accuracy is needed, it has to be precomputed into the data by providing more points.

Explicit setting of "VMG=...;" in the Waypoint Description prevails.

The polar syntax is compatible with popular Weather Routing programs, but please note that for long distance cruising the route planning approach is usually different than for game/racing under sail, so there is no interpretation of any column as the "best angle for beating upwind".

There is no optimization of routes, just simulation of forecast performance.

The other way of providing polar curve sets is by pointing to a text file (extension .pol) via the Tools->Settings dialog (can be set to "none").
There can be at most one Polar Curve Set loaded at any time.

The full Windows installer package for what I called 2.5.926 can be downloaded from [link=http://www.4shared.com/file/YhnIPcQE/opencpn_25926_setup.htm] here [/link] (please backup your valuable environment before trying...). It includes also the fixes mentioned recently.

Enjoy.

Piotr
__________________
PjotrC is offline   Reply With Quote
Old 26-09-2011, 12:45   #10
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Route Planning with GRIB - Work in Progress

Piotr..

Downloaded and installed your v. 2.5.926 which executed displaying a small GE window to the left on top of a grey OCPN window. The GE globe displayed briefly where I could see glowing routes in the background before it all aborted. Running windows Vista,not working here.

Here is the logfile:

15:41:02: 2011-09-26
15:41:02: -------Starting opencpn-------
15:41:02: Version 2.5.926 Build 2011-09-26
15:41:02: MemoryStatus: mem_total: 2037 mb, mem_initial: 10 mb
15:41:03: SData_Locn is D:\PROGRAM FILES\OpenCPN\
15:41:03: Using existing Config_File: C:\ProgramData\opencpn\opencpn.ini
15:41:03: Setting Viewpoint Lat/Lon 58.0804, 7.8605
15:41:03: Setting Ownship Lat/Lon -23.4491, -45.0745
15:41:03: Digesting Polar Curve
15:41:03: Digesting Polar Curve
15:41:03: Digesting Polar Curve
15:41:05: System default Language: en_GB
3:41:05 PM: Opencpn language set to: en_US
3:41:07 PM: Using s57data in D:\PROGRAM FILES\OpenCPN\s57data
3:41:07 PM: Using Tide/Current data from: D:\PROGRAM FILES\OpenCPN\tcdata\
3:41:07 PM: Setting Viewpoint Lat/Lon 58.0804, 7.8605
3:41:07 PM: Setting Ownship Lat/Lon -23.4491, -45.0745
3:41:07 PM: NMEA Data Source is....None
3:41:07 PM: AIS Data Source is....Serial:COM7
3:41:09 PM: Using WVSChart datafile: D:\PROGRAM FILES\OpenCPN\wvsdata\wvs43.dat
3:41:09 PM: NMEA AutoPilot Port is....None
3:41:09 PM: PlugInManager searching for PlugIns in location D:\PROGRAM FILES\OpenCPN\plugins
3:41:09 PM: PlugInManager: Loading PlugIn: D:\PROGRAM FILES\OpenCPN\plugins/dashboard_pi.dll
3:41:09 PM: PlugInManager: Loading PlugIn: D:\PROGRAM FILES\OpenCPN\plugins/gecomapi_pi.dll
3:41:09 PM: [GECOMAPI] Config params loaded: WW=1, ASH=1, DGA=1, USG=1, SB=1, WF=3, Az=0, Ti=0, Ra=440, Opa=255
3:41:09 PM: [GECOMAPI] Constructing the GE plugin window
3:41:09 PM: [GECOMAPI] GE plugin - OnSize event
3:41:09 PM: [GECOMAPI] GE resize requested
3:41:09 PM: [GECOMAPI] GE plugin - OnShow event
3:41:09 PM: [GECOMAPI] GE plugin - OnShow event
3:41:09 PM: [GECOMAPI] GE plugin - OnSize event
3:41:09 PM: [GECOMAPI] GE resize requested
3:41:09 PM: [GECOMAPI] GE plugin - OnSize event
3:41:09 PM: [GECOMAPI] GE resize requested
3:41:09 PM: [GECOMAPI] GE plugin - OnSize event
3:41:09 PM: [GECOMAPI] GE resize requested
3:41:09 PM: PlugInManager: Loading PlugIn: D:\PROGRAM FILES\OpenCPN\plugins/grib_pi.dll
3:41:09 PM: PlugInManager: Loading PlugIn: D:\PROGRAM FILES\OpenCPN\plugins/wmm_win32_pi15_v03_pi.dll
3:41:09 PM: [GECOMAPI] GE initialization requested
3:41:09 PM: [GECOMAPI] Initializing GE
3:41:09 PM: [GECOMAPI] GE found running, killing it
3:41:13 PM: [GECOMAPI] GE killed
3:41:16 PM: [GECOMAPI] We survived CoCreateInstance
3:41:27 PM: [GECOMAPI] We survived waiting for IsInitialized
3:41:27 PM: [GECOMAPI] GE Initialized, attaching to the window
3:41:27 PM: [GECOMAPI] Attaching/detaching to GE window requested
3:41:27 PM: [GECOMAPI] Attaching to the GE window
3:41:28 PM: [GECOMAPI] GE resize requested
3:41:28 PM: [GECOMAPI] Resizing GE
3:41:30 PM: [GECOMAPI] GE resized
3:41:30 PM: [GECOMAPI] GE window attached/detached
15:48:28:



Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 26-09-2011, 13:11   #11
Registered User

Join Date: Feb 2010
Posts: 619
Re: Route Planning with GRIB - Work in Progress

Tore,

Thanks for trying... but I think the GE plugin should not be accessible at all from this parallel installation. It is certainly not included there.... just leave the grib_pi.dll in the plugins directory.

P.
__________________
PjotrC is offline   Reply With Quote
Old 26-09-2011, 14:47   #12
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Route Planning with GRIB - Work in Progress

Pjotr..

OK, I've done a parallell installation of your version and collected the latest grib data for today.

I've set up a route and inserted a starting time at 10:00 local time.
Now what? I can see no entries in the new coloumn in the Route Manager?

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_01 Sep. 26 17.41.jpg
Views:	295
Size:	237.5 KB
ID:	32098  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 26-09-2011, 16:16   #13
Registered User

Join Date: Feb 2010
Posts: 619
Re: Route Planning with GRIB - Work in Progress

So far so good... from your screenshot I can see that you probably did not enter the starting time (hit Enter) after typing in the date-time.
__________________
PjotrC is offline   Reply With Quote
Old 26-09-2011, 16:24   #14
Registered User

Join Date: Feb 2010
Posts: 619
Re: Route Planning with GRIB - Work in Progress

Quote:
Originally Posted by cagney View Post
No problem compiling but an immediate crash on start...
Thomas,

It just occurred to me that you might have the same problem as Tore had initially - due to the changed plugin interface only the newly built plugins can be present - safe is to have only the new grib_pi. Others will likely crash.

P.
__________________
PjotrC is offline   Reply With Quote
Old 26-09-2011, 16:54   #15
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Route Planning with GRIB - Work in Progress

Pjotr...

OK, got it..working now. BUT, the wind information shown in the Route Manager
for waypoint 7/8 does not correspond with the values in the GRIB table.
Route properties SW 4 kn. Grib display control 291 degr. 19 kn.

Unless the wind strenght in the Route properties is 4 Beaufort scale and the
Grib display in knots,in which case it should be from 11-16 knots.

I DO have the latest version 0.7 of the GE Plugin. The grib_pi v. 1.1 came with the
latest OCPN v. 2.5.0 Build 2011-07-26 so I presume that is also valid?

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_02 Sep. 26 19.45.jpg
Views:	292
Size:	244.1 KB
ID:	32102  
__________________

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Route Planning Using Existing Waypoints edsailing OpenCPN 5 24-08-2011 03:38
iPad Route Navigation Cotemar Navigation 3 05-05-2011 07:25



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 23:34.


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.