This repository contains python scripts for analysing the running tasks on ArduCopter.
In order to execute these scripts, the file tasks.txt and the ardupilot repository are needed.
For getting the file tasks.txt, use mavproxy.py and get the file with: ftp get @SYS/tasks.txt.
Also, make sure that the commit of ardupilot is the same as the one running on your flight controller.
It summarizes the properties of running tasks based on the file tasks.txt and their configuration which is extracted from Ardupilot code.
As output, you get a file named tasks_prop.yaml if your file is named tasks.txt.
It is used to evaluate changes in the running tasks, e.g. due to different thread properties.
It requires as input the results of analysis.py of the 2 tasks.txt to be compared.
The comparison is based on checking how the stats of each task has changed.
For example, if a given task has less overruns in the second tasks_prop.yaml, it is considered as an improvement.
But if it has more overruns, it is considered a setback.
Furthermore, if a task has more improvements than setbacks, the task execution is considered to be improved.
In a similar way, if it has more setbacks, it is considered to be worsened.
- Get both
tasks.txtto be analysed. Make sure you rename them in order to know the difference, e.g.tasks_scenario1.txtandtasks_scenario2.txt. - Run the analysis for both
tasks.txtfiles. You just need to runpython analysis.py <path/to/ardupilot> <path/to/tasks_scenario1.txt>, and repeat it fortasks_scenario2.txt. - Run the comparison:
python comparison.py <path/to/tasks_sceneario1_prop.yaml> <path/to/tasks_sceneario2_prop.yaml>. - You will see an output like this one:
Improvements 124, Setbacks 83, Improved tasks 42(53.16%), Worsened tasks 24(30.38%), Global improvements 22.78%, out of 79 tasks
If you see more improvements than setbacks, and the improved tasks are more than the worsened tasks, the results are positive. In this case, the global improvements are also going to be positive (it will be negative in case of more worsened tasks than improved tasks). Remember that the results of the comparison are considered improvements when there is a reduction of the corresponding value in the second file.
Use the option --help for more info about running the scripts.