This repository provides scripts for computing Cross Track Error (CTE) from video data captured while running trained models on the DonkeyCar platform. The CTE is calculated by analyzing vehicle trajectory relative to the track centerline using overhead video recorded from a ceiling-mounted, downward-facing camera.
src
├── main.py
├── Mean_and_std_dev.py
└── draw_plot.py- opencv
- numpy
- matplotlib
- scipy
-
Clip the video.
-
Organize the video files:
- Create a
videofolder under the project root directory. - Place the original and clipped versions of the video in the
videofolder.- Video format must be
.mp4. - Name the clipped version as:
original_name_cliped.mp4.
- Video format must be
- Create a
-
Run the main script:
python3 src/main.py your_video_file_name
- Do not include the .mp4 extension in
your_video_file_name. - The output will be saved in a new subfolder under the data directory.
- The results will include:
- An annotated video.
- A CSV file containing CTE (Cross-Track Error) values for each frame.
- Compute mean and standard deviation of CTEs:
python3 src/Mean_and_std_dev.py subfolder_name- Visualize CTE over time:
python3 src/draw_plot.py subfolder_nameThis will generate a real-time CTE plot aligned with the annotated video.
Distributed under the MIT License. See LICENSE for more information.
Tyler Ruble, Zhongzheng R. Zhang, Giancarlo Vidal