UBCSailbot / raye-local-pathfinding

UBC Sailbot's Local Pathfinding Repository: OMPL-based pathfinding that avoids upwind/downwind sailing, minimizes turning, and minimizes path length.
https://www.ubcsailbot.org/
MIT License
2 stars 0 forks source link

Break apart track_made_good and true_heading #267

Open tylerlum opened 2 years ago

tylerlum commented 2 years ago

Right now, our code treats track_made_good and true_heading as identical. However, this is not always the case. We need to make changes in the code to properly model and handle this difference.

track_made_good is purely the direction that the boat is moving, which is independent of our heading. This is calculated as some type of changing in GPS lat/lon position over time.

true_heading is the direction that the boat is pointing towards.

From discussion with the team, we believe that, in an environment with 0 ocean current, the sailboat track_made_good = true_heading is a reasonable approximation. The only time this changes is when we make a sharp turn, but once the boat picks up speed, the "sideways" movement is primarily gone.

Thus, almost all of the difference between track_made_good and true_heading is in the ocean current.

image

The place that needs the biggest change is in:

  1. MOCK_sensors.py: Before update position over time with SPEED and HEADING. Now update position over time with SPEED and TRACK_MADE_GOOD. Also, the speed of the boat should take into account the ocean current. Right now, the speed measurement ignores the ocean_current.
  2. utilities.py: Need to change measuredWindToGlobalWind and globalWindToMeasuredWind to use SPEED AND HEADING AND TRACK_MADE_GOOD (before just speed and heading).

When changing from boat-frame to world-frame, we need to be careful with the use of speed, heading, and track_made_good. heading sets the rotation of the boat coordinate frame wrt world-frame. track_made_good is used to break up the speed into components. Currently, these methods assume heading == track_made_good

tylerlum commented 2 years ago
  1. Converting between measured and global wind

image

patrick-5546 commented 2 years ago

image