Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All the script rely on the class DebugData in "scripts/util/parser.py". This design makes it easy to make adjustments in case the file format changes. However, if you modify the internal data structure of DebugData (e.g. change the name of one of its member variables) you will have to modify the scripts that access to that data. Che Check the class documentation in the code for more information. Note that DebugData can be used to parse only the debug file produced by ca2, not the one written by the simulator.

plot_trajectory.py
This script allows to analyze offline the data of an experiment. The program ca2 saves a file in the same folder of the executable called "data_carX.txt" which contains lots of data describing position, speed, heading, etc. of the car in each car cycle. Similarly, the simulator produces a file called "debug_sim.txt". The main difference between the two files is that the first one reports values of the physical quantities that are affected by measurement noise while the second one report also the real state of the system. Moreover, the car can records the status of the internal variables which are unknown to the simulator.

...

  1. Open "plot_trajectory.py".
  2. Use your editor's search feature (usually CTRL+F) to find the string "TODO". You should find a code section titled "TODO configure which info to plot".
  3. Assign to variables graphX_vals the arrays containing the info you want to be plotted. The array will likely be a member variable of the class DebugData defined in "scripts/util/parser.py" or one of the _*sim_vals arrays defined inside plot_trajectory.py that represent the data extracted from the simulator debug file. Check the class code documentation in DebugData and plot_trajectory.py (section "SIMULATOR DEBUG VARIABLES") for details.

The little red crosses show the value of the specified attribute at the current step.

...