Hi
Is there any way that anyone knows of to automatically set a waypoint based on direction of travel?
If anyone has any example code or could point me to an existing project I can pick apart I would appreciate it.
I want to activate a magnetic reed switch, read the current direction of travel (I suppose that would be the bearing) from a self made tilt compensated compass and set the waypoint automatically a set distance directly ahead of the vessle.The majority of the code I find has manually set waypoints included in the code.
I get confused sometimes between all the bearings, heading etc terminology or peoples definitions of them.
I also need a way to determine when I activate the switch that it is the front of the vessle that is pointing in the direction of travel.
Is there an easier way to achieve this?
From previous posts of mine I have determined due to cross currents etc that for steering purposes I do need to use both compass and gps so as I have them already mostly implemented I may as well use them.
Example.
I point my vessel in the direction I want it to go which happens to be 180 degrees. I then need to tell the code that I am pointing at 180 degrees and not 0 degrees and then use that bearing to calculate my waypoint which would invlolve taking my current gps coordinate and adding a fixed value to either the longitude or latitude which shouldn't be too difficult, although I am guessing I would need a lookup table or something to know wether to add or subtract and wether to add or subtract to latitude or longitude.
So I have 2 queries.
- How to tell my code which is the front of my vessel and use the subsequent bearing ahead of it.
- Use the bearing to automatically set my waypoint a set distance ahead of the current position.