Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 15-02-2018, 21:32   #1
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,414
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:	657
Size:	355.1 KB
ID:	164251  
seandepagnier is offline   Reply With Quote
Old 16-02-2018, 04:55   #2
Registered User

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

Nice. Very impressive screen shot.

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

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
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, 10:28   #4
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
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, 12:10   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
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, 17:57   #6
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,414
Re: autopilot route plugin

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

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
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, 14: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, 14:57   #9
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
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, 15:41   #10
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,414
Re: autopilot route plugin

What exact message?

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

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
Re: autopilot route plugin

I have tried, It fails. See

http://www.cruisersforum.com/forums/...ml#post2583335

http://www.cruisersforum.com/forums/...ml#post2583706


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

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
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, 09:13   #13
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
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, 15:04   #14
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
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, 07:39   #15
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,414
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?
seandepagnier 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
How to Convert "*.route" Route File into ".*wpt" File To Be Used in Maxsea V.10 doiroda Navigation 7 12-03-2020 06:00
DR Plugin - splitting up GPX route files Rasbats OpenCPN 30 09-02-2019 11:42
Plugin development... How to receive chart objects in my plugin? dmartinez OpenCPN 6 04-08-2017 00:56
Accessing active route data in the Plugin interface? Brett Muir OpenCPN 2 07-07-2016 17:34
Broken download link, Route plugin Northern Irelan OpenCPN 1 21-04-2015 16:32

Advertise Here


All times are GMT -7. The time now is 02:19.


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.