Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Extract parameter default values from an ArduPilot .bin log file #26057

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

amilcarlucas
Copy link
Contributor

@amilcarlucas amilcarlucas commented Jan 22, 2024

Contains unittests with 96% coverage

@peterbarker how should I integrate the unittests with the autotest suite?

@amilcarlucas
Copy link
Contributor Author

To run coverage do:

cd Tools/autotest/param_metadata
python3 -m coverage run -m unittest extract_param_defaults_unittest.py
python3 -m coverage html
firefox htmlcov/extract_param_defaults_py.html

@khancyr
Copy link
Contributor

khancyr commented Jan 22, 2024

we don't gather coverage for python code for now. Adding it should quite simple, generate the coverage report and put it in the upload directory for coveralls. Then it should appears online.

@amilcarlucas
Copy link
Contributor Author

amilcarlucas commented Jan 22, 2024

Thanks Pierre,

My question is how to integrate the unit tests so that they run every time the extract_param_defaults.py or extract_param_defaults_unittest.py file changes?

Coverage information is just a cherry on top. Nice but not important now.

@IamPete1
Copy link
Member

I don't think its a good idea to provide defaults files, this makes it harder for us to change the defaults going forward as users will now have out of date files they will be comparing to. The defaults are also only valid in the particular configuration that the parameters are in. So the defaults are only correct with the context of the set parameter values.

What problem is this trying to solve? Mission planner now shows the defaults for all parameters in its full list.

@amilcarlucas
Copy link
Contributor Author

amilcarlucas commented Jan 22, 2024

I am trying to solve the problem of managing (without MP) multiple sets of parameters for multiple vehicles.
I want to store only the parameters that change relative to the defaults of a particular vehicle in a particular configuration in a particular version.

I do not think that generating default.param files and distributing them is a good Idea. I do not distribute them on https://discuss.ardupilot.org/t/how-to-methodically-tune-almost-any-multicopter-using-arducopter-4-4-x/110842 for the reasons you mention.

But I do need to get them in a machine readable format so that I can automate their management. This is the reason for this script.

@andyp1per
Copy link
Collaborator

I agree with @IamPete1 about providing defaults files - but this does not do that - it just makes it easier to get at them which seems ok to me

@amilcarlucas amilcarlucas force-pushed the pr_extract_param_defaults branch 3 times, most recently from 78623d9 to 9d8eb40 Compare January 23, 2024 13:43
@amilcarlucas
Copy link
Contributor Author

All checks pass

@tridge tridge removed the DevCallEU label Feb 7, 2024
.github/workflows/test_extract_params_default.yml Outdated Show resolved Hide resolved
.github/workflows/test_extract_params_default.yml Outdated Show resolved Hide resolved
.github/workflows/test_extract_params_default.yml Outdated Show resolved Hide resolved
@amilcarlucas amilcarlucas force-pushed the pr_extract_param_defaults branch 3 times, most recently from f69cb41 to 0d8af88 Compare February 13, 2024 12:50
@tridge tridge removed the DevCallEU label Feb 14, 2024
@amilcarlucas amilcarlucas force-pushed the pr_extract_param_defaults branch 7 times, most recently from 59fe041 to 6f0fcce Compare February 20, 2024 12:49
@amilcarlucas amilcarlucas changed the title Tools: Extracts parameter default values from an ArduPilot .bin file. Tools: Extract parameter default values from an ArduPilot .bin log file Feb 20, 2024
@amilcarlucas
Copy link
Contributor Author

Tests pass.

Supports Mission Planner, MAVProxy and QGCS file format output

Contains unittests with 95% coverage

Amilcar do Carmo Lucas, IAV GmbH
@tridge tridge merged commit 74640c9 into ArduPilot:master Feb 21, 2024
92 checks passed
@amilcarlucas amilcarlucas deleted the pr_extract_param_defaults branch February 22, 2024 10:40
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants