Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 15-02-2018, 22:32   #1
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,516
autopilot route plugin

initial working version (requires opencpn from git as well)

http://github.com/seandepagnier/autopilot_route_pi

The idea is to improve the logic for following routes with an autopilot.

Some basic improvements include:

1) performed using spherical calculations (opencpn cheats using mercator)
2) various modes and tuneable parameters
3) more custom route leg display

In the future I intend:

1) additional tuning parameters
2) additional route leg display options
3) boundary support
4) automatic avoid collision with ais targets
5) sailing rules to prevent jibing or luffing sails with significant wind shifts


In the screenshot below, the actual track overlaps the planned route with maximum error of 5 meters. The wind was below 5 knots, so the boat speed was 1-2 knots, and still possible to track closely using "route position bearing" mode which has no discontinuities at waypoints, and improves on XTE mode in many situations.
Attached Thumbnails
Click image for larger version

Name:	autopilot_route.jpg
Views:	311
Size:	355.1 KB
ID:	164251  
__________________

boat_alexandra is offline   Reply With Quote
Old 16-02-2018, 05:55   #2
Registered User

Join Date: Jun 2010
Location: St. Petersburg, Florida
Boat: Gemini 3200
Posts: 818
Re: autopilot route plugin

Nice. Very impressive screen shot.

Fabbian
__________________

fgd3 is offline   Reply With Quote
Old 16-02-2018, 12:05   #3
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

Looking pretty nice Sean. I'm going to try vdr simulation with it.
rgleason is offline   Reply With Quote
Old 20-02-2018, 11:28   #4
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

Sean, to run this new PI do I need to setup for MSVC++2017 and the newer version of wxWidgets and use the resultant opencpn.lib which is API 1.15?

Since the v4.8.2 release on Feb 6 you guys have been very busy adding to Opencpn.
One of the commits is
Merge pull request #994 from transmitterdan/wx311Updates

which is for using wxWidgets 3.11 I believe.

It appears I can get this new version of
Add the NOAA tilesets to chart downloader. 1.0.146

3 hours ago by Pavel Kalian master aee79014

Simply by download https://ci.appveyor.com/project/bdbcat/opencpn/build/1.0.146/artifacts

That will contain opencpn.lib (API version 1.15) so I will be able to standalone compile autopilot_route_pi and then run it without having to reconfigure my MSVC++ to 2017 and wxWidgets 3.11

----However... Should I be reconfiguring anyway?
rgleason is offline   Reply With Quote
Old 20-02-2018, 13:10   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

Well, I tried compiling it with MSVC++2013 and the old wxWidgets, using
cmake -T v120_xp .. and of course it had some errors... are these because I have not moved on to wxWidgets 3.11 and MSVC++2017?

Quote:

"C:\Users\Frederick\Documents\GitHub\autopilot_rou te_pi\build\ALL_BUILD.vcxproj
" (default target) (1) ->
"C:\Users\Frederick\Documents\GitHub\autopilot_rou te_pi\build\autopilot_route_p
i.vcxproj" (default target) (3) ->
(ClCompile target) ->
C:\Users\Frederick\Documents\GitHub\autopilot_rout e_pi\src\autopilot_route_pi
.cpp(549): error C3867: 'std::list<waypoint,std::allocator<_Ty>>::clear': funct
ion call missing argument list; use '&std::list<waypoint,std::allocator<_Ty>>::
clear' to create a pointer to member [C:\Users\Frederick\Documents\GitHub\autop
ilot_route_pi\build\autopilot_route_pi.vcxproj]
C:\Users\Frederick\Documents\GitHub\autopilot_rout e_pi\src\computation.cpp(79
): error C2065: 'M_PI' : undeclared identifier [C:\Users\Frederick\Documents\Gi
tHub\autopilot_route_pi\build\autopilot_route_pi.v cxproj]
C:\Users\Frederick\Documents\GitHub\autopilot_rout e_pi\src\computation.cpp(80
): error C2065: 'M_PI' : undeclared identifier [C:\Users\Frederick\Documents\Gi
tHub\autopilot_route_pi\build\autopilot_route_pi.v cxproj]
C:\Users\Frederick\Documents\GitHub\autopilot_rout e_pi\src\apdc.cpp(363): err
or C2065: 'GL_SMOOTH_LINE_WIDTH_RANGE' : undeclared identifier [C:\Users\Freder
ick\Documents\GitHub\autopilot_route_pi\build\auto pilot_route_pi.vcxproj]
C:\Users\Frederick\Documents\GitHub\autopilot_rout e_pi\src\apdc.cpp(372): err
or C2065: 'GL_ALIASED_LINE_WIDTH_RANGE' : undeclared identifier [C:\Users\Frede
rick\Documents\GitHub\autopilot_route_pi\build\aut opilot_route_pi.vcxproj]
C:\Users\Frederick\Documents\GitHub\autopilot_rout e_pi\src\apdc.cpp(557): err
or C2065: 'GL_SMOOTH_LINE_WIDTH_RANGE' : undeclared identifier [C:\Users\Freder
ick\Documents\GitHub\autopilot_route_pi\build\auto pilot_route_pi.vcxproj]
C:\Users\Frederick\Documents\GitHub\autopilot_rout e_pi\src\apdc.cpp(566): err
or C2065: 'GL_ALIASED_LINE_WIDTH_RANGE' : undeclared identifier [C:\Users\Frede
rick\Documents\GitHub\autopilot_route_pi\build\aut opilot_route_pi.vcxproj]

3 Warning(s)
7 Error(s)
rgleason is offline   Reply With Quote
Old 20-02-2018, 18:57   #6
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,516
Re: autopilot route plugin

It should compile now, but you must use the git version of opencpn, and the opencpn.lib generated from it.
boat_alexandra is offline   Reply With Quote
Old 22-02-2018, 14:39   #7
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

Sean, it does indeed compile now. I tried it in v4.99 and it is rejected with a message to get an updated version of O. So now I will git fetch and compile O.


I'm gettting an error in compiling O


Quote:
Build FAILED.

"C:\Users\Frederick\Documents\GitHub\OpenCPN\build \ALL_BUILD.vcxproj" (default
target) (1) ->
"C:\Users\Frederick\Documents\GitHub\OpenCPN\build \WXSVG.vcxproj" (default targ
et) (13) ->
(ClCompile target) ->
C:\Users\Frederick\Documents\GitHub\OpenCPN\src\wx svg\src\svgxml\svgxml.cpp(2
4): fatal error C1083: Cannot open include file: 'expat.h': No such file or dir
ectory [C:\Users\Frederick\Documents\GitHub\OpenCPN\build\ WXSVG.vcxproj]

0 Warning(s)
1 Error(s)
It looks like I need to check dependencies. expat.h for example.
I will run a clean and try again first.

later; no dice. did not fix it.
rgleason is offline   Reply With Quote
Old 22-02-2018, 15:19   #8
Registered User
 
CareKnot's Avatar

Join Date: Sep 2016
Location: Greater Houston Galveston Metroplex
Boat: 1979 Endeavor 32
Posts: 337
Re: autopilot route plugin

Sean,

This looks very promising. Nicely done. Unfortunately I cannot test the plugin at this time. The boat is dockbound and I am homebound working on other things. To make matters worse, my Nexus 6 phone is toast (I broke a step on a dock ladder and got dunked). So I'm conducting business from my laptop while also working on my pet project.

In the meantime, I have been doing a little research. It turns out that a great deal that has already been accomplished by others. Their intended applications are much more ambitious than mine and the distinct possibility exists that the system I envision will be simplified quite a bit by comparison.

Ultimately, I am going to need to know what data, in what format, you will need to incorporate it into the AP route plugin and how to create a layer for chart overlay that is updated dynamically. But a few things have to be finalized before I get to that point.

This is one source I have been studying. You may find it interesting: MDPI Open Access Journals - Simulation of a Geiger-Mode Imaging LADAR System for Performance Assessment
__________________
Kindest Regards,
Phillip
CareKnot is offline   Reply With Quote
Old 22-02-2018, 15:57   #9
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

Pavel has provided a good workaround just using Continuous Integration and Appeveyor so I am going to use this

https://ci.appveyor.com/project/bdbc....161/artifacts

Using this version 4.99.0 and the opencpn.lib, I am still getting a message saying ap_route is not compatible to get an updated version

Nothing seems to work.
rgleason is offline   Reply With Quote
Old 22-02-2018, 16:41   #10
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,516
Re: autopilot route plugin

What exact message?

Did you build opencpn from git also? It shoudl work.
boat_alexandra is offline   Reply With Quote
Old 23-02-2018, 06:07   #11
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

I have tried, It fails. See

Beta Test / Technical

Beta Test / Technical


Also using the Appveyor compile the plugin is not accepted.
See Pavel's comments.
rgleason is offline   Reply With Quote
Old 23-02-2018, 07:23   #12
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

Message: Autopilot_route_pi is not compatible with this version of Opencpn.
rgleason is offline   Reply With Quote
Old 23-02-2018, 10:13   #13
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 418
Re: autopilot route plugin

Only a quick try.
I Can activate a route, and a window popsup. This is an always ontop nonborder window, therefore I can not move it around the screen to a position I like.
It is not posible to unactivate the route again (at least not with the right mouse click). In the rightclicke menu the item 'activate route' remains and if clicked somehow a new instance is started and causing in the output a doubled nmea sentence.
Dirk
__________________
Navigation is know where you are and what to do to get where you want.
But also: Know where you don't want to be and what to do to don't get there.
rooiedirk is offline   Reply With Quote
Old 23-02-2018, 16:04   #14
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 13,669
Re: autopilot route plugin

Sean, can I go back to an earlier version of 4.99.0 that will compile properly?
Pavel has made a number of changes that will not work with MSVC2013.

I need to know which commit to compile that has your essential code so that the plugin will be accepted and O will compile with MSVC2013 and wxWidgest 3.0.2!!!

Otherwise I will not be able to help.
rgleason is offline   Reply With Quote
Old 28-02-2018, 08:39   #15
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,516
Re: autopilot route plugin

Quote:
Originally Posted by rooiedirk View Post
Only a quick try.
I Can activate a route, and a window popsup. This is an always ontop nonborder window, therefore I can not move it around the screen to a position I like.
It is not posible to unactivate the route again (at least not with the right mouse click). In the rightclicke menu the item 'activate route' remains and if clicked somehow a new instance is started and causing in the output a doubled nmea sentence.
Dirk
You can drag the window holding "alt" I should add the border as an option.

You can deactivate by right clicking the route window rather than main chart.

The double output sounds like a bug. Thanks for feedback.

Quote:
Originally Posted by rgleason View Post
Sean, can I go back to an earlier version of 4.99.0 that will compile properly?
Pavel has made a number of changes that will not work with MSVC2013.

I need to know which commit to compile that has your essential code so that the plugin will be accepted and O will compile with MSVC2013 and wxWidgest 3.0.2!!!

Otherwise I will not be able to help.
I do not find your errors. Are they the same as appveyor?
__________________

boat_alexandra is offline   Reply With Quote
Reply

Tags
autopilot, plug, route

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
DR Plugin - splitting up GPX route files Rasbats OpenCPN 30 09-02-2019 12:42
Plugin development... How to receive chart objects in my plugin? dmartinez OpenCPN 6 04-08-2017 01:56
Accessing active route data in the Plugin interface? Brett Muir OpenCPN 2 07-07-2016 18:34
Broken download link, Route plugin Northern Irelan OpenCPN 1 21-04-2015 17:32
How to Convert "*.route" Route File into ".*wpt" File To Be Used in Maxsea V.10 doiroda Navigation 6 10-07-2011 00:53

Advertise Here


Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 17:38.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.