OpenMarine

Full Version: Autopilot route plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I've installed the autopilot route plugin from Sean's GIT repository, and enabled it in OpenCPN 5 on OP2 Buster.
When drawing a route and pressing activate the console canvas appears with the XTE reading, amongst others.
However, OpenCPN instantly is stuck and the Deactivate button in the console canvas is also not responding.

Have I configured something wrong? Hope someone can help.

New information:

- When checking the "magnetic" box, the plugin works. 

Any way to solve this?
Another bug:

- When a route close by is activated, with a lot of "close by" waypoints, opencpn closes instantly.

Example:

[Image: 2020-07-19-20-58-23-SV-Scylla-openplotte...Viewer.png]

Strange thing is, this route does have some "close by" waypoints, but these are reversed so shouldn't be a problem
It does work when the boat is not near the route.

The following settings make no difference:

- Waypoint bearing
- Standard XTE
- Route position bearing

Have I misconfigured something? Or does OpenCPN crash because it has too many calculations based on the many waypoints?
it's hard to say. Can you post your route file so I can try to crash it also?

The plugin uses great circle calculations, but there is an option to use mercator, does that make any difference?

Does everything work correctly with a route with fewer waypoints?
The gpx file is: gpx file download
My starting coordinates are: 52.636306,5.059992
I've tried various settings, and the settings when it crashes are:

- gps (so, compass unchecked) does not work, compass check works. 
- edit: if no gps data is available, but gps mode is enabled opencpn will not freeze, when gps mode is enabled and gps data is available opencpn will freeze
- great circle (shortest distance) does not work, mercarator (constant bearings) does work
- intercept route on current course does not work
- 1hz works, 10hz crashes opencpn, 2 and 5hz reverses the heading and does strange things with gps reception

Following tests have been done with magnetic mode on because gps mode does not work, I guess I would have other results if gps mode will work:

- waypoint bearing works, however will not take the next waypoint that is in the given direction, but rather takes another one, sometimes even the one you just passed. It seems to ignore direction of the rout.

[Image: 2020-07-21-15-46-57-Start.png]

- Standard XTE does the following, chooses the one I just passed:

[Image: 2020-07-21-15-53-31-Start.png]

- Route position bearing comes closest to following the rout, but in the beginning of the route still steers in the direction of the opposite route:

[Image: 2020-07-21-15-55-08-Start.png]

But, then as it approaches the first corner, it will follow the normal route again:

[Image: 2020-07-21-15-55-38-Start.png]

So, it seems that sometimes the direction of the route is ignored and just sees all waypoints as possible directions, based on the plugin configuration, even if this means it is a waypoint behind you or if you are approaching a near waypoint for the other direction.

Some configurations will close opencpn, and some will make it freeze opencpn.
The best configuration for me, to avoid these problems is this one:

[Image: 2020-07-21-16-32-43-Start.png]
Ok, wow. There are some bugs it seems, but the 2/5/10hz thing seems very strange, I will investigate in the next week or so.

It isn't going to work very well on "magnetic" sentences, because it's applying computed declination but this doesn't compensate other small errors some of which vary over time. So I would first figure out how to get pypilot working in gps mode without routes.. does this work at all?

As for "o, it seems that sometimes the direction of the route is ignored and just sees all waypoints as possible directions"
This is correct. Normally when you activate a route it is supposed to steer toward it and follow it. If your route is a complete loop, how is it supposed to know if it should start at the beginning or end?

There are definite improvements that could be made, but your outline a troubling number of bugs that I was unaware of... Did you also try following routes with the builtin opencpn route following (disable the autopilot route plugin) to compare?
(2020-07-24, 01:24 AM)seandepagnier Wrote: [ -> ]Ok, wow.  There are some bugs it seems,  but the 2/5/10hz thing seems very strange, I will investigate in the next week or so.

It isn't going to work very well on "magnetic" sentences, because it's applying computed declination but this doesn't compensate other small errors some of which vary over time.   So I would first figure out how to get pypilot working in gps mode without routes.. does this work at all?

As for "o, it seems that sometimes the direction of the route is ignored and just sees all waypoints as possible directions"
This is correct.  Normally when you activate a route it is supposed to steer toward it and follow it.   If your route is a complete loop, how is it supposed to know if it should start at the beginning or end?

There are definite improvements that could be made, but your outline a troubling number of bugs that I was unaware of...   Did you also try following routes with the builtin opencpn route following (disable the autopilot route plugin) to compare?

To answer your questions:

- GPS mode does not work, OpenCPN will not crash but will freeze altogether.
- What you say about route direction is true, haven't thought about that. I would say the only way to know is if you take manual control of the helm, steer into the start direction you want.
If the heading then is correct, activate the route and then it will work. Another way maybe for it to work is to calculate the closest waypoint, and if the "id" of that waypoint in relation to your position is "forward" or "reverse" then it would know which waypoint should be chosen first. I think that is how the default opencpn route works, but I'm not sure. For now I have set the "max error angle" in your plugin to less meters, this will follow a closer line and not pick up waypoints in the loop that goes back.
- I have tried following a route with the default opencpn route capabilities, but I am still struggling with gains and some other configuration. I will sail out again today and try some modifications.
I have tested it in the dock with a GPS simulator and then it works fine, however on the water strange things happened. The only difference was that instead of a simulator that had only gps sentences with 10kn of speed, I now had the normal signalk stream that also had magnetic sentences, and maybe some other interfering ones. I am still in the process of what the disturbance was.


I am glad I at least provided some information, because I think this plugin is really great and has even greater potential I think. Maybe even integrate AIS objects into the calculation and provide warnings with course correction suggestions, which you can confirm after seeing it with your own eyes. In this way you don't have to re-draw the route. This was one of the difficulties in my situation, activating a route while dealing with some traffic. But, I am blathering about again, I have lot's of automating ideas I am willing to discuss with you. But I would already be glad if the bugs are fixed and I can use the current features.
I don't know why opencpn freezing with gps. Maybe you have a data loop? Don't expect to be able to follow routes with magnetic mode, I stuck this in as an after though to be complete and never actually tested it or expected it to work.
(2020-07-24, 01:28 PM)seandepagnier Wrote: [ -> ]I don't know why opencpn freezing with gps.   Maybe you have a data loop?   Don't expect to be able to follow routes with magnetic mode, I stuck this in as an after though to be complete and never actually tested it or expected it to work.

I also cannot use gps with the pypilot plugin.  And I just rebuild a brand new setup from scratch yesterday.  Same result using the latest git source.
does opencpn freeze for you also?
Thanks Sean
If I use the autopilot route app yes OpenCpn freezes. If I just select gps instead of compass mode, pypilot plugin disconnects and restarts. If I just activate a route without APR enabled it just ignores the action and continues on following the current set heading.
Other things I noticed today with the new build.
AP is deactivated once in a while. Maybe crashing the plugin? Not sure I’ve only noticed after I lost my heading.
OpenCPN 5.2 crashes while adjusting heading offset. Usually after more then 45deg change in offset. It can be repeatable by making large adjustments quickly.
Pages: 1 2 3