Versions Compared

Key

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

...

Debug
I wrote a python script called "plot_trajectory.py" that can be used to speed up considerably the debugging of the experiment both simulated and on test-bed. See #SCRIPTS to understand its usage.

CAR SOFTWARE

...

Since the code of the car is split into modules, there are a couple of differences concerning the uploading and compilation of the source code.

Create your project
The folder on cars' computers that I have used is located at "/Desktop/brainstem/aProject/Andrea". The structure of the code is changed so to make the compilation working I had to motify the makefiles. As a consequence, if you want to create your own folder to expand my branch of the project you should start by copying mine (See section on creating new branch on main documentation).

Upload a new code version
The car sorce to compile and run needs both the folders "car_src" and "util". If you write a new version of the code and you want to upload it on the cars with sftp, you must upload both those folders. Of course you can avoid updating both if the changes affect only the code in one of the two folders.

Compilation
The compilation of the new code does not differ from the previous versions. Just type make (or make new in case you have used make clean before) in the project folder. Make sure that the constant CODE_IN_CAR in file "car_src/const_car.h" is set to 1.

Paths
The path specification files I have used with have the suffix "_precise" in their name in the same way of the simulator. As usual, you can find these files in the foflder "/Desktop/brainstem/aDebug/aUnix/i686".

...

SCRIPTS

...

The scripts are written in Python. Most of them rely on the debug file that ca2 leaves after execution. At the beginning of the script, after the imports there is always a "configuration" section (delimited by comments) which contains all the (documented) constant variables that must be set appropriately to make the script do exactly what you want.

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 can be used to debug experimental data (not simulated) using the command line option "o" (see below).

Command line options

  • -o:

...

SCRIPTS

...

TROUBLESHOOTING (SOFTWARE)

...

  • The car does not follow the path correctly. Make sure that the paths specified in "src/sim_src/const_sim.h" by the constant FILE_NAMES are consistent with the experiment configuration.

ca2

  • The car does not follow the path correctly. Make sure that the constant CAR_NUM in "car_src/const_car.h" is set coherently with the symbol at the top of the car.

DISTURBANCES ANALYSIS

In this section a quantitative analysis of the disturbances in the system is attempted. In order to deal in an easier way with the assumption of monotonicity and with the coupling between the steer and the motor input, the model is linearized and the lateral and the longitudinal components are separated. The coupling effect is seen as a disturbance. In the following the coordinate system will be relative to the path as represented in Figure coord_sys.jpg. In other words, y represents the position along the path while x the lateral distance from the path.

...