Closed Frankybeen29 closed 7 months ago
Implementation:
@Frankybeen29
Video:
We can also log distance2route, x and y and plot them with python along the original route and mark the biggest deviation:
Covered Test cases:
testCalc: 1) Calculate the focuspoint and distance from this focuspoint to the last focuspoint, take the 2. point of the route 2) Calculate the focuspoint and distance from this focuspoint to the last focuspoint, take the last point of the route
testPointDistance: 1) Calculate the distance from the route to a point, the start point is closest 2) Calculate the distance from the route to a point, the closest is somewhere in the middle 3) Calculate the distance from the route to another point, the closest is somewhere in the middle
Everything added to docs
Feasibility
The track is defined by several line segment. The position of the car is displayed as a point. The distance of the car to the track can be found by calculating the distance of the point to every line segment (https://www.geeksforgeeks.org/minimum-distance-from-a-point-to-the-line-segment-using-vectors/):
Or as one formula: $d_{\text{min}} = \left| \vec{w} - \left( \frac{{\vec{v} \cdot \vec{w}}}{{\vec{v} \cdot \vec{v}}} \right) \cdot \vec{v} \right| = \left|\vec{w} - \vec{r}\right|$
When the distance between car and the track does not exceed a certain threshhold (e.g. the turning radius of the car), then the car keeps track. Here, a system test can be written that with every timestep checks if the threshold is adhered to. If that's the case for the entire track, the test is passed.
Limitations
We have a large but limited resolution for the comparation. We measure every 10ms therefore the resolution should be high enogh but is still limited. We also track only differences that a higher than 4m because that should be sensible enough.
@Frankybeen29
Conclusion
Task is feasible.