SignalK / freeboard-sk

Chartplotter implementation for Signal K servers
Apache License 2.0
35 stars 27 forks source link

show laylines to waypoint #149

Closed petsicola closed 2 months ago

petsicola commented 4 months ago

show laylines to waypoint image

panaaj commented 3 months ago

Available in v2.8.0

petsicola commented 3 months ago

Laylines should only be visible when the waypoint is upwind. If the heading to the waypoint is direct, they should disappear. do you think that?

panaaj commented 3 months ago

Upwind...sure can add that. What angle range would be considered direct?

petsicola commented 3 months ago

I think that I would show them until the wind exceeds 90 degrees

panaaj commented 3 months ago

Fixed in v2.8.2

petsicola commented 3 months ago

About the laylines. in dashT tactics plugin explain the problem of laylines. 1º Laylines are displayed until the direct route is faster than the laylines. This is calculated with the polars. you can see it in the tactics plugin doc. https://dashboard-tactics-pi.readthedocs.io/en/latest/tactics/tactics.html 2º I think that in our case the laylines should be shown when the route to the waypoint is upwind, not when the boat is upwind. Anyway, I'll give you an example later.

panaaj commented 3 months ago

Will fix 2. display when destination is upwind (not the vessel)

petsicola commented 2 months ago

I think there is an Issue, sorry... I think that laylines are in downwind

No lay lines image

Yes lay lines image

  1. inside this two white lines show lay lines
  2. outside this laylines don't show lay lines image

In mx tommy kip configuration. this two white lines are sawn in this angle. 35 degrees in each tack, in this case. you can put a configuration.. when do you want to show lay lines like that image

petsicola commented 2 months ago

With an image... when the green point is inside the two white lines you have to show the laylines. and as I said in the other message this lines are configured by the user in mxtommy kip.

image

panaaj commented 2 months ago

@petsicola The Close Haul value in KIP settings is not available to Freeboard-SK, so it cannot be used to determine when to display the laylines. This value would need to be added as a setting in Freeboard-SK and set to match the value entered into KIP. Ideally this would be sourced from a Signal K path (e.g. polars) but one can't guarantee that the path will be populated with a value.

So, for clarity moving forward, I am going to propose that..... Laylines will be displayed when ALL of the following conditions are met:

  1. A destination location is set
  2. The difference in value between Bearing to Destination and True Wind Direction is less (TACKANGLE / 2) (where the default TACKANGLE = 90)

Note: These rules will apply regardless of the vessel heading.

If these rules are applied will this meet your use case?

petsicola commented 2 months ago

Yes! only one thing I don't know if it is a problem... what happens if true direction wind angle is 5º and bearing to destination is set at 359º the difference are 6º but 359-5=354º

if that is a problem... I don't know.... Henry in that discord message gives a solution in node red and I think that we have to make something similar... https://discord.com/channels/1170433917761892493/1170456013552496730/1238797469098180618

sorry I have a poor english and we are talking by github.

tkurki commented 2 months ago

Some additional thoughts - there are several different things at play here.

Laylines represent the most efficient way of reaching your destination, given the presentwind conditions

If you have a destination / mark set and you know the boat's (present condition) upwind target angles you can show Upwind Mark Laylines. Same for downwind. These are not dependent on where the boat is pointing, only on the boat and mark's positions relative to the true wind direction. So when the mark is upwind of the boat the laylines are drawn downwind from the mark and vice versa if the mark is downwind.

Boat laylines are not dependent on the destination being set, as they are just a function of the present true wind angle and the boat's upwind and downwind target angles. Boat laylines are drawn upwind or downwind from the boat, depending on where the boat is going (courseOverGround I think).

If you have both Boat laylines and Mark Laylines available where they meet is the Tack point. Drawing the laylines for both tacks just up to the tack point results in the 4 line shape.

https://chsmith.com.au/news/what-are-laylines-and-how-do-they-work-2013-04-24-8-31-07.html

To summarise:

Second point: To make Freeboard and Kip play together is for both to use boat target angles, either as fixed values or calculated dynamically from polar data.

godind commented 2 months ago

I concur with this explanation. To remove the confusion around the term layline, in the tacking angle settings (be it fixed or from a path), I prefer the term Close-hauled Angle when referring to the boat's upwind target angle.

Using perf and polar will clear this. We are not there yet. but the data is!

petsicola commented 2 months ago

which is the path that I have to use to show lay lines???

panaaj commented 2 months ago

They will show when bearing is +/- performance.beatAngle (or 45 deg if there is no value) of true wind.

petsicola commented 2 months ago

Laylines doesn´t appear always. in some casses. doesnt appear.

petsicola commented 2 months ago

In this position laylines... I think that the have to appear. image