Versions Compared

Key

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

...

  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 code documentation in DebugData and plot_trajectory.py (section "SIMULATOR DEBUG VARIABLES") for details. Of course you can print another any array-like structure as long as it as the same length of lab_data.time.

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

Command line options

  • -b: parse and integrate both "data_carX.txt" and "debug_sim.txt". When this option is used, the trajectory shown and the information presented in the top left corner graphic are the real one, not the ones affected by measurement noise that cars perceive. This is useful to check that everything is going fine with the simulator. Note that the simulator and ca2 are asynchronous (the clock rate of the simulator is much higher than the car's one), thus, in order to integrate the two files, the script must replicate/cut some data according to the desired clock cycle specified through the option "-c".
  • -c (default 0.1): the time between two represented steps. For example, if you call the script by typing python plot_trajectory.py -c1.0, pressing 'n' will show the status of the car 1 second later.
  • -t (default 0.0): the initial time shown by the script. For example, if you want to investigate an event that happened 40 seconds after the beginning of the experiment, you can invoke the script as python plot_trajectory.py -t40.0 instead of starting from the beginning and press 'n' until you reach that point.
  • -s (default 20): the number of segments in the trail of the represented trajectory.meas counts possono essere saltati

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.

...