Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 12-11-2020, 08:43   #91
Registered User

Join Date: Sep 2015
Location: France
Boat: Atlantis 360
Posts: 35
Re: ShipDriver - another BETA!!!

Hi mike
Would it be possible in the preference to Add a parameter.
Maximum speed
and to have the possibility to set the ship speeed upto the defined Max speed.
I would need that for academic reasons. The maximum speed could be up to 10 000 Nds.
That would be great.
All my best
Gilles
LEPINARD is offline   Reply With Quote
Old 12-11-2020, 12:39   #92
Registered User

Join Date: May 2012
Posts: 1,208
Re: ShipDriver - another BETA!!!

Gilles...

Unusual! I am sending a PM.

Mike
Rasbats is offline   Reply With Quote
Old 14-11-2020, 23:46   #93
Registered User

Join Date: May 2012
Posts: 1,208
Re: ShipDriver - another BETA!!!

ShipDriver is now in the master catalog of managed plugins. No changes to the way it works.

Please provide feedback here if you have problems.

Douwe Fokkema added the ability to include tidal current (using sliders) for his fork of the plugin. Intend adding this at some point.

Mike
Rasbats is offline   Reply With Quote
Old 04-12-2020, 12:59   #94
Registered User

Join Date: Feb 2020
Posts: 36
Re: ShipDriver - another BETA!!!

Hi Mike,
I'm developing an opensource autopilot, Fenix Autopilot. Autopilot implements an internal compass.
Link to Fenix Autopilot forum thread
It would be very useful to use ShipDriver plugin as a test bench of the autopilot if own ship would react to diferent Heading values received from autopilot.
Could you(or any one reading this post) give me some guidance on how to implement the following in ShipDriver?
- Get Heading value of own ship from OpenCPN (received through HDM message from autopilot compass). I guess this is possible by calling a function of the API but not sure how to do it.
- COG = Heading value.
In consequence, ShipDriver will calculate next lat/long based on SOG and new COG.

I have already compiled the pluggin with Visual Studio, if I get this guidance I am confident to make it work and share it with the community of course!

Thank you!

Regards,
Sergio
spascual90 is offline   Reply With Quote
Old 05-12-2020, 06:54   #95
Registered User

Join Date: May 2012
Posts: 1,208
Re: ShipDriver - another BETA!!!

Sergio...

You could adapt the function which reacts to the 'APB' sentence:

Code:
void ShipDriver_pi::SetNMEASentence(wxString &sentence) {

    // $GPAPB,A,A,0.10,R,N,V,V,011,M,DEST,011,M,011,M*3C 

    if (NULL == m_pDialog) return;

    wxString token[40];
    wxString s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
    token[0] = _T("");

    wxStringTokenizer tokenizer(sentence, wxT(","));
    int i = 0;

    while (tokenizer.HasMoreTokens()) {
        token[i] = tokenizer.GetNextToken();
        i++;
    }
    if (token[0].Right(3) == _T("APB")) {
        
        s11 = token[11];

        if (m_pDialog->m_bAuto) {

            double value;
            s11.ToDouble(&value);
            m_pDialog->myDir = value;
        }
        /*
        s6 = token[6];
        if (s6 == _T("A")) {
            wxMessageBox(_("Vessel has arrived at the final waypoint"));
        }
        */

    }
 }
Look at the NMEA0183 spec for $xxHDM to see what changes are needed

Then the model will turn to that heading and disregard the 'Heading' set in the dialog:

Code:
void Dlg::Notify()
{
    wxString mySentence;
    plugin->SetNMEASentenceHDM(mySentence);
Not sure if this is enough. PM me if you need more info.

Mike
Rasbats is offline   Reply With Quote
Old 05-12-2020, 15:00   #96
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,640
Images: 2
Re: ShipDriver - another BETA!!!

HDM has just two parameters
HDM - Heading, Magnetic

  1. Heading Degrees, magnetic
  2. M = magnetic
https://opencpn.org/wiki/dokuwiki/do...ading_magnetic

Perhaps this would help to test Sean's Autopilot_Route plugin too, but I am still trying to determine how this would work.
rgleason is offline   Reply With Quote
Old 06-12-2020, 03:30   #97
Registered User

Join Date: Feb 2020
Posts: 36
Re: ShipDriver - another BETA!!!

Quote:
Originally Posted by Rasbats View Post
Sergio...

You could adapt the function which reacts to the 'APB' sentence:

Code:
void ShipDriver_pi::SetNMEASentence(wxString &sentence) {

    // $GPAPB,A,A,0.10,R,N,V,V,011,M,DEST,011,M,011,M*3C 

    if (NULL == m_pDialog) return;

    wxString token[40];
    wxString s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
    token[0] = _T("");

    wxStringTokenizer tokenizer(sentence, wxT(","));
    int i = 0;

    while (tokenizer.HasMoreTokens()) {
        token[i] = tokenizer.GetNextToken();
        i++;
    }
    if (token[0].Right(3) == _T("APB")) {
        
        s11 = token[11];

        if (m_pDialog->m_bAuto) {

            double value;
            s11.ToDouble(&value);
            m_pDialog->myDir = value;
        }
        /*
        s6 = token[6];
        if (s6 == _T("A")) {
            wxMessageBox(_("Vessel has arrived at the final waypoint"));
        }
        */

    }
 }
Look at the NMEA0183 spec for $xxHDM to see what changes are needed

Then the model will turn to that heading and disregard the 'Heading' set in the dialog:

Code:
void Dlg::Notify()
{
    wxString mySentence;
    plugin->SetNMEASentenceHDM(mySentence);
Not sure if this is enough. PM me if you need more info.

Mike
Thank you Mike,
I just made it work!

I "destroyed" a bit the original code just to get the HDM reading+myDir updating. Once I clean it I will share a workable version. I also want to make some videos working with Fenix Autopilot.

if (token[0].Right(3) == _T("HDM")) {

s1 = token[1];

double value;
s1.ToDouble(&value);
m_pDialog->myDir = value;
}

Regards,
Sergio
spascual90 is offline   Reply With Quote
Old 06-12-2020, 03:37   #98
Registered User

Join Date: Feb 2020
Posts: 36
Re: ShipDriver - another BETA!!!

Quote:
Originally Posted by rgleason View Post
HDM has just two parameters
HDM - Heading, Magnetic

  1. Heading Degrees, magnetic
  2. M = magnetic
https://opencpn.org/wiki/dokuwiki/do...ading_magnetic

Perhaps this would help to test Sean's Autopilot_Route plugin too, but I am still trying to determine how this would work.
Thanks for the reference!

Before investing effort in other autopilot, just take into account that your autopilot also has to implement a part of the simulation: the reaction to changes of rudder into the boat compass bearing.
This is implemented in Fenix Autopilot. In simulation mode, Fenix HDM messages are not reflecting internal compass bearing but a simulation.
If you want to know more about this please let me know as this feature is not documented (I developed for testing purposes).
Regards,
Sergio
spascual90 is offline   Reply With Quote
Old 08-12-2020, 08:56   #99
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,640
Images: 2
Re: ShipDriver - another BETA!!!

Sergio, I am trying to get my head around this, so thanks for your offer.


Quote:
Consider "that your autopilot also has to implement a part of the simulation: reaction to changes of rudder into the boat compass bearing."
Quote:
In simulation mode, Fenix HDM messages are not reflecting internal compass bearing but a simulation.
  1. Let's say a Nmea data flow is available from a VDR recording being played back, but what Nmea sentences are needed to do a simulation?
  2. A route has to be setup in OpenCPN and then made active. Doing causes OpenCPN to send NMEA RMB and APB sentences to the AutoPilot.
  3. Alternatively we can use Simulation and Testing "Navigate to here" to send ECxxx sentences "You may need to filter outgoing sentences on the network connection to only send “EC” (and filter out the same on the incoming side to avoid feedback) so you don't receive them and then send duplicates."
  4. I think the route instructions needed are now being sent to the autopilot, but what is missing?
  5. We need something to motivate the boat to move at some speed.
  6. We need this virtual boat to have feedback as to where it is located (GPS simulation), what direction it is pointed in (Heading) and how it is doing on this virtual journey.
  7. I keep thinking of something like Shipdriver as the testing tool, but you are suggesting that the autopilot itself can be put into test mode.
  8. I don't understand this yet. Can you enlighten me?
  9. BTW Sean's autopilot_route_pi is an alternative to the functions that are built into OpenCPN. He has several different ways of keeping the boat on the route. Since I have been building and packaging his plugin for some time, I am looking for a way to test it before release without actually being on the boat.


Quote:
Originally Posted by spascual90 View Post
Thanks for the reference!

Before investing effort in other autopilot, just take into account that your autopilot also has to implement a part of the simulation: the reaction to changes of rudder into the boat compass bearing.
This is implemented in Fenix Autopilot. In simulation mode, Fenix HDM messages are not reflecting internal compass bearing but a simulation.
If you want to know more about this please let me know as this feature is not documented (I developed for testing purposes).
Regards,
Sergio
rgleason is offline   Reply With Quote
Old 08-12-2020, 13:57   #100
Registered User

Join Date: May 2012
Posts: 1,208
Re: ShipDriver - another BETA!!!

Perhaps Sergio can confirm how his autopilot feeds to OpenCPN?

As I see it:
OpenCPN outputs APB when a route is activated.
Fenix Autopilot receives APB and adjusts course to achieve the heading needed.
Fenix Autopilot transmits HDM sentence.
ShipDriver receives HDM and converts this to m_dir.
ShipDriver turns to heading of m_dir. (Does not use APB directly and the ShipDriver autopilot button is not needed)

Mike
Rasbats is offline   Reply With Quote
Old 08-12-2020, 18:47   #101
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,640
Images: 2
Re: ShipDriver - another BETA!!!

Quote:
Originally Posted by Rasbats View Post
Perhaps Sergio can confirm how his autopilot feeds to OpenCPN?

As I see it:
OpenCPN outputs APB when a route is activated.
Fenix Autopilot receives APB and adjusts course to achieve the heading needed.
Fenix Autopilot transmits HDM sentence.
ShipDriver receives HDM and converts this to m_dir.
ShipDriver turns to heading of m_dir. (Does not use APB directly and the ShipDriver autopilot button is not needed)

Mike

Thanks Mike, for clearing up my muddle.
rgleason is offline   Reply With Quote
Old 12-12-2020, 07:57   #102
Registered User

Join Date: Feb 2020
Posts: 36
Re: ShipDriver - another BETA!!!

Quote:
Originally Posted by Rasbats View Post
Perhaps Sergio can confirm how his autopilot feeds to OpenCPN?

As I see it:
OpenCPN outputs APB when a route is activated.
Fenix Autopilot receives APB and adjusts course to achieve the heading needed.
Fenix Autopilot transmits HDM sentence.
ShipDriver receives HDM and converts this to m_dir.
ShipDriver turns to heading of m_dir. (Does not use APB directly and the ShipDriver autopilot button is not needed)

Mike
Hello, Mike is more responsive than I am. To much work before Christmas!

Mike, your flow is correct, just a clarification in step 2 and additional simulation step 3.

1. OpenCPN outputs APB when a route is activated.
2. Fenix Autopilot receives APB and adjusts rudder (not course) to achieve the heading needed.

3. Here it comes the simulation function: Fenix calculates boat course based on current heading + current rudder angle.

4. Fenix Autopilot transmits HDM sentence.
5. ShipDriver receives HDM and converts this to m_dir.
6. ShipDriver turns to heading of m_dir. (Does not use APB directly and the ShipDriver autopilot button is not needed)

The simulation function is similar to the attacheded diagrams.
The theory: The turn rate is proportional to the rudder angle except when the rudder is aligned to the hull, where the course is unstable.

The simulation: I include a random factor that implements the unstability of turn rate within certain margins (red and blue lines). Green line is an example of turn rates along a change of rudder angle from portboard to starboards.

Hope this clarifies why you need a compass simulation function in your autopilot and how to implement it.

Regards,
Sergio
Attached Thumbnails
Click image for larger version

Name:	course.jpg
Views:	38
Size:	26.5 KB
ID:	228515   Click image for larger version

Name:	simulation.jpg
Views:	39
Size:	177.2 KB
ID:	228516  

spascual90 is offline   Reply With Quote
Old 12-12-2020, 08:05   #103
Registered User

Join Date: Feb 2020
Posts: 36
Re: ShipDriver - another BETA!!!

Quote:
Originally Posted by spascual90 View Post
Thank you Mike,
I just made it work!

I "destroyed" a bit the original code just to get the HDM reading+myDir updating. Once I clean it I will share a workable version. I also want to make some videos working with Fenix Autopilot.

if (token[0].Right(3) == _T("HDM")) {

s1 = token[1];

double value;
s1.ToDouble(&value);
m_pDialog->myDir = value;
}

Regards,
Sergio
I just made some nice videos of Fenix autopilot working with OpenCPN in Track and Auto modes. ShipDriver modified to simulate GPS. Fenix simulating Compass.









Enjoy!
Sergio
spascual90 is offline   Reply With Quote
Old 12-12-2020, 09:33   #104
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,640
Images: 2
Re: ShipDriver - another BETA!!!

Sergio, thank you for the additional detail and explanation!
Having a means establish the sensitivity of the rudder makes good sense to me, perhaps there should be a way to adjust it? But since this is just testing maybe not.
I wonder why we don't see the active route in the video. Thanks for those videos too.

Fenix Autopilot Website

Fenix Autopilot Overview and Handbook
Configuration of OpenPlotter
Configuration of OpenCPN
Calibrate BNO055 IMU sensor

Github Fenix Autopilot

Addafruit BNOo55 IMU Sensor (100hz)
Bosch BNOo55 IMU Sensor
rgleason is offline   Reply With Quote
Old 12-12-2020, 10:38   #105
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,640
Images: 2
Re: ShipDriver - another BETA!!!

Fenix Autopilot added to Beta Plugins
(Realize this is both software and hardware, but the software is no github)
Spasqual90 if you'd like to write a brief description in a text file attached here, I will add it.
rgleason is offline   Reply With Quote
Reply


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
Beta Test / Technical bdbcat OpenCPN 2880 25-04-2024 02:44
Have you ever been hit by another boat in another country? autumnbreeze27 General Sailing Forum 18 16-01-2017 12:14
Beta Marine Diesel michaelmrc Engines and Propulsion Systems 48 23-03-2016 13:44
November 12th - Becalmed, bothered and bewildered (another riff on another song) and skipgundlach General Sailing Forum 0 15-11-2007 18:30

Advertise Here


All times are GMT -7. The time now is 20:04.


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.