Versions Compared

Key

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

...

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" which is integrated by the script with the information in the car's file. 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.

The script normally parse only the "data_carX.txt" and thus it can be used to debug experimental data (not simulated) both simulated and experimental data. You can have a graphical representation of the information contained in "debug_sim.txt" using the command line option "o-b" (see below for full description). In this case the script integrates the information in the two files.

Usage

  1. Run a simulation (or an experiment) to obtain the debug files. Do not stop the program with CTRL+C or the debug file will not be terminated correctly.
  2. Open plot_trajectory.py and set the car number and the paths to debug files you want to analyze.
  3. Run the script by typing python plot_trajectory.py on the console.
  4. Focusing the console, use keys (lowercase) 'n' to go to the next step, 'p' to go to the previous one, 'q' to quit.

The script displays four plot. On the top left corner there is the path and the trajectory of the car with some information. The little red cross represents the target point of the path. The other 3 graphics show the evolution of some attribute in time. You can configure which attribute to plot with the following precedure.

  1. Open "plot_trajectory.py"

...

  1. .
  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".

...

  1. Assign to variables graphX_vals the arrays containing the info you want to be plotted.

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

Command line options

  • -ob:

util/predictor.py
This is a reimplementation in Python of the supervisor algorithms in "src/car_src/supervisor.c". It is very helpful for testing the supervisor offline instead of running the experiment on the test-bed over and over. This speed up considerably the debugging of the supervisor.

...