Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-11-2017, 19:29   #1321
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,732
Re: Help / FAQ

Stn92

Attached is the EBL Properties page, note the choices available may be quite useful in solving your problem.

Rotate with boat
Maintain with heading or course over ground
EBL angle (port/starboard)
EBL Fixed end position
Show VRM
Always show EBL information
Persistant
Attached Thumbnails
Click image for larger version

Name:	EBL-Properties.jpg
Views:	24
Size:	70.6 KB
ID:	159004  
__________________

__________________
rgleason is online now   Reply With Quote
Old 10-11-2017, 03:11   #1322
Registered User

Join Date: Feb 2017
Posts: 22
Re: Help / FAQ

Two class B AIS transponders.
__________________

__________________
stn92 is offline   Reply With Quote
Old 10-11-2017, 14:03   #1323
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,732
Re: Help / FAQ

Have you tried the plugin yet?
__________________
rgleason is online now   Reply With Quote
Old 10-11-2017, 18:11   #1324
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,087
Re: Help / FAQ

Quote:
Originally Posted by stn92 View Post
Two class B AIS transponders.
Are you aware of their update frequency and accuracy? For docking a ship, I would expect something like at least a 10Hz high precision position/motion vector sources to be needed. Nothing like that is present in the class B equipment available on the market.
__________________
nohal is online now   Reply With Quote
Old 11-11-2017, 04:58   #1325
Registered User

Join Date: Feb 2017
Posts: 22
Re: Help / FAQ

Quote:
Originally Posted by rgleason View Post
Have you tried the plugin yet?
Yes i did. Thanks. But drawing the speed vectors which moving with boat, rotating with it and etc. - is not such difficult. I already did it.
[SPOILER]
Code:
            drawVector(false,ownship.v22.x, ownship.v22.y, v22);
            drawVector(true, ownship.v21.x, ownship.v21.y, v21);
            drawVector(false, ownship.v12.x, ownship.v12.y, v12);
            drawVector(true, ownship.v11.x, ownship.v11.y, v11);

void drawVector(bool out,  int posx, int posy, const Vector& v) {
    if (v.value > 1){ //если значение вектора не меньше порогового значения
        posx = floor(posx)*scale_factor_x;
        posy = floor(posy)*scale_factor_y;
        int value = -v.value*cc1->GetVPScale()*0.25;
        int angle = v.angle;
        angle -= gCog; // компенсируем угол поворота судна
        if (angle < 0) angle += 360;
        glTranslatef(posx, posy, 0);
        glRotatef(angle, 0, 0, 1);

        glBegin(GL_LINES);
        glVertex2f(0, 0);
        glVertex2f(0, value);
        glEnd();
      
        if (out){
            glBegin(GL_LINES);
            glVertex2f(0, value);
            glVertex2f(-5, value + 6);
            glEnd();

            glBegin(GL_LINES);
            glVertex2f(0, value);
            glVertex2f(5, value + 6);
            glEnd();
        }
        else {

            glBegin(GL_LINES);
            glVertex2f(0, 0);
            glVertex2f(-5, -6);
            glEnd();

            glBegin(GL_LINES);
            glVertex2f(0, 0);
            glVertex2f(5, -6);
            glEnd();

        }

        glRotatef(-angle, 0, 0, 1);
        glTranslatef(-posx, -posy, 0);
    }
}
[/SPOILER]

Now I need to find the point of the nearest intersection with the boundary of the s57 object(land, mole etc.). Just need the point. Draw a line to this point and calculate the distance - this is not a problem.
__________________
stn92 is offline   Reply With Quote
Old 11-11-2017, 06:34   #1326
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,732
Re: Help / FAQ

Nice, I guess you've got this figured out.

Perhaps look in weather_routing_pi code, where Sean figures out distance to GSHHS Background High Resolution and avoids land?

I could try to find that, but you're probably a lot faster at that than I am.

https://github.com/seandepagnier/weather_routing_pi

Would this become a new plugin?
__________________
rgleason is online now   Reply With Quote
Old 11-11-2017, 13:24   #1327
Registered User

Join Date: Feb 2017
Posts: 22
Re: Help / FAQ

Quote:
Originally Posted by rgleason View Post
Nice, I guess you've got this figured out.

I could try to find that, but you're probably a lot faster at that than I am.
I did not mean anything like that. I just wanted to say that my problem is not how to draw a vector. The language barrier greatly distorts the meaning. Sorry for wasting your time.
__________________
stn92 is offline   Reply With Quote
Old 18-11-2017, 03:50   #1328
Registered User

Join Date: Feb 2017
Posts: 22
Re: Help / FAQ

I figured out how to find closest intersection point with chart object.

This is the code. Maybe it will be useful to someone, too.

It retuns the lat/lon of the cosest intersection point with the specified object types on whole chart. The radius limitation does not work yet.

And example of using
Code:
std::vector<wxString> types = { "SLCONS", "LNDRGN", "LNDARE", "FLODOC", "PONTON" };
           
g_pi_manager->FindClosestObject(target_plugin_chart, gLat, gLon, 5, cc1->GetVP(), &minLat11, &minLon11, types);
      
dist11 = distance(gLat, gLon, minLat11, minLon11);
This is how it works. (not Paint this time)
__________________

__________________
stn92 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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 06:52.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.