How to calculate the GPS Coordinates 5m Left and Right from you Position?
maybe some of you know that there are GPS tools out there that are used in Motorsports. A lot of them deliver the following function: If you drive with your car and you press a button at a certain point this GPS Coordinate will be stored and every time you drive over this coordinate a LapTime will be stored. For a small application a need a similar function. But here is my problem: Since you wi开发者_开发技巧ll never hit the exact Coordinate twice these tools store the coordinates of a Line and if you hit one of the coordinates of this line the Lap is finished. How do I calculate such a line? If you look at my Picture, the red dot is the coordinate where the user hits the button to start a lap and the green Line is what the device stores and uses as a virtual finish line and not only the Coordinate where the red dot is. Any Idea how I can calculate such a line? I really don't get it since the line is never ideal directed to north or south.
Thank you very much
twickl
You can "see" on which side of the line the car is.
You can take a look at this previous stackoverflow question. However, you should keep in mind that GPS accuracy varies by 5-50 metres, and also the speed at which the car is moving might introduce further error to such model.
You would have to take at least the previous GPS co-ordinate to be able to work out the direction the car was moving when the button was hit, and from that you can get the left and right.
I can see it being problematic though. As you probably know, GPS is only accurate to a distance of 5 metres (at best). And depending on how often you're polling for a GPS co-ordinate, you could be a few metres out again (given that the car is presumably moving at a fair speed!). You also have issues if the finish line is on or close to a corner, as you would likely not be calculating the direction of the car correctly.
Interesting app though!
精彩评论