Autopilot code has needed to be refactored. Specially the part when the autopilot searches the closest frame to the current car position. This part has been completely rewritten.
Now it uses an heuristic algorithm. The code guesses that the closest frame would be around the last found. This could be true because the frames are sorted as a path and we are using a kind of follow path algorithm
The old algorithm is still in the project and it can be used, although it returns wrong closest frames. It will be deprecated when the autopilot is refactored
The main goal of this development was to completed the workflow from driving to autopilot, passing through the telemetry and the csv file. I didn't want to modify the autopilot at all, since we are planning to make a full refactor of the code. However, finally I had to modify it, as little as I could
Using the VPReplayAsset is an inheritance of the previous autopilot. When we refactor the autopilot, an adhoc format will be used for the autopilot
Autopilot still uses raw input. It'll use the processed input as we discuss
HeuristicFrameSearcher maintains some of the naming and structure of the previous implementation. It will change and be improved with the refactor
Autopilot telemetry
This development allows to use a csv telemetry file at the autopilot
How to use
https://user-images.githubusercontent.com/25863696/152835827-3b31af24-0281-4a52-96c8-51f196bb71dc.mp4
File format
Autopilot needs a VPReplayAsset, so we create a VPReplayAsset through the csv data. VPReplay asset needs position, rotation, and raw input, so this information must be contained into the csv The main code of this transformation can be found here: https://github.com/PERRINN/project-424-unity/blob/f16582eaf8d2ace5d6da5715af12ee06f253ebb0/Assets/Features/Telemetry%20Lap%20File/TelemetryLapToReplayAsset.cs
Autopilot
Autopilot code has needed to be refactored. Specially the part when the autopilot searches the closest frame to the current car position. This part has been completely rewritten. Now it uses an heuristic algorithm. The code guesses that the closest frame would be around the last found. This could be true because the frames are sorted as a path and we are using a kind of follow path algorithm The old algorithm is still in the project and it can be used, although it returns wrong closest frames. It will be deprecated when the autopilot is refactored
Known Issues
The main goal of this development was to completed the workflow from driving to autopilot, passing through the telemetry and the csv file. I didn't want to modify the autopilot at all, since we are planning to make a full refactor of the code. However, finally I had to modify it, as little as I could