Skip to content

Commit

Permalink
IMPROVEMENT: SPDX tags and codacy lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amilcarlucas committed Jun 13, 2024
1 parent d10464d commit dd41bc2
Show file tree
Hide file tree
Showing 24 changed files with 183 additions and 72 deletions.
5 changes: 5 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Software architecture
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

Before we decided on a software architecture or programming language or toolkit we gathered software requirements as presented below.

Expand Down
5 changes: 5 additions & 0 deletions BLOG-discuss1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
![Cinewhoop Diatone Taycan MX-C|586x500](upload://naJEdzmLeF8hvzupJCpLBT7tZay.jpeg)
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

For illustrative purposes, we will use the small 3'' multicopter depicted above, but the tuning sequence we developed at [IAV GmbH](https://www.iav.com/) will work on almost any other multicopter.

Expand Down
5 changes: 5 additions & 0 deletions BLOG-discuss2.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Continuation from the Blog post above....
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

For better accuracy, you should do that for all directions and take the average. In our case, we got:

Expand Down
7 changes: 6 additions & 1 deletion BLOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# How to methodically tune (almost) any multicopter using ArduCopter 4.4.x
# How to methodically tune any ArduCopter
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

![Cinewhoop Diatone Taycan MX-C](cinewhoop.png)

Expand Down
75 changes: 40 additions & 35 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
ArduPilot Methodic Configurator Developer Code of Conduct
=========================================================
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

Rev 1.0 Apr 3nd 2024

Expand All @@ -24,51 +29,51 @@ Our Pledge
In the interest of fostering an open and welcoming environment, we as
developers and maintainers pledge to:

- Endeavour to make participation in our project and our community a
harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level
of experience, nationality, personal appearance, race, religion, or
sexual identity and orientation.
- Endeavour to understand the intent of development activities they
undertake, where there may be reason to think that the vehicle may
be used as a weapon or in an application where it is effectively in
control of human life.
- Not knowingly support or facilitate the weaponization of systems
using Ardupilot or ArduPilot Methodic Configurator
- ArduPilot and ArduPilot Methodic Configurator are NOT certified for
use in applications where ArduPilot is effectively in control of human
lives. Members of the development team must not knowingly assist in
projects where ArduPilot will be in control of human lives.
“In control of human lives” includes but isn’t limited to manned
aircraft.
- Endeavor to make participation in our project and our community a
harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level
of experience, nationality, personal appearance, race, religion, or
sexual identity and orientation.
- Endeavor to understand the intent of development activities they
undertake, where there may be reason to think that the vehicle may
be used as a weapon or in an application where it is effectively in
control of human life.
- Not knowingly support or facilitate the weaponization of systems
using ArduPilot or ArduPilot Methodic Configurator
- ArduPilot and ArduPilot Methodic Configurator are NOT certified for
use in applications where ArduPilot is effectively in control of human
lives. Members of the development team must not knowingly assist in
projects where ArduPilot will be in control of human lives.
“In control of human lives” includes but isn’t limited to manned
aircraft.

Our Standards
-------------

Examples of behavior that contributes to achieving the aims of ArduPilot
Methodic Configurator include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by contributors include:

- The use of sexualized language or imagery and unwelcome sexual
attention or advances
- Trolling, insulting/derogatory comments, and personal or political
attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or
electronic address, without explicit permission
- Modifying ArduPilot Methodic Configurator code to intentionally support
weaponization
- Knowingly designing, testing or using weaponized systems running
ArduPilot Methodic Configurator
- Other conduct which could reasonably be considered inappropriate in
a public or professional setting
- The use of sexualized language or imagery and unwelcome sexual
attention or advances
- Trolling, insulting/derogatory comments, and personal or political
attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or
electronic address, without explicit permission
- Modifying ArduPilot Methodic Configurator code to intentionally support
weaponization
- Knowingly designing, testing or using weaponized systems running
ArduPilot Methodic Configurator
- Other conduct which could reasonably be considered inappropriate in
a public or professional setting

Our Responsibilities
--------------------
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Contributing
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

## How to contribute to the ArduPilot Methodic Configurator project?

Expand Down
5 changes: 5 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
recursive-include MethodicConfigurator/vehicle_templates *.param
recursive-include MethodicConfigurator/vehicle_templates *.json
recursive-include MethodicConfigurator/vehicle_templates *.jpg
Expand Down
1 change: 1 addition & 0 deletions MethodicConfigurator/extract_param_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def output_params(params: Dict[str, float], format_type: str = 'missionplanner',
elif format_type == "qgcs":
print(f"{sysid} {compid} {param_name:<15} {param_value:.6f} {MAV_PARAM_TYPE_REAL32}")


def main():
args = parse_arguments()
parameter_values = extract_parameter_values(args.bin_file, args.type)
Expand Down
3 changes: 3 additions & 0 deletions MethodicConfigurator/frontend_tkinter_template_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def on_row_double_click(self, event):
ProgramSettings.store_template_dir(selected_template_relative_path)
self.root.destroy()


def argument_parser():
"""
Parses command-line arguments for the script.
Expand All @@ -134,6 +135,7 @@ def argument_parser():
'providing a clear and intuitive interface for parameter management.')
return add_common_arguments_and_parse(parser)


def main():
args = argument_parser()

Expand All @@ -143,5 +145,6 @@ def main():

print(ProgramSettings.get_recently_used_dirs()[0])


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion MethodicConfigurator/get_release_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def compute_average(issues_date):
return sum_of_issues / len(issues_date)
return sum_of_issues


def main():
api_token = None
gh = Github(api_token)
Expand Down Expand Up @@ -70,5 +71,4 @@ def main():


if __name__ == "__main__":

main()
40 changes: 25 additions & 15 deletions MethodicConfigurator/tempcal_imu.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,17 +456,35 @@ def IMUfit(logfile, outfile, # pylint: disable=too-many-locals, too-many-bra
print(f"Loaded {len(data.accel[0]['T'])} accel and {len(data.gyro[0]['T'])} gyro samples")

if progress_callback:
progress = 210
progress_callback(progress)
progress_callback(210)
if not tclr:
# apply moving average filter with 2s width
data.Filter(2)

c, clog = generate_calibration_file(outfile, online, progress_callback, data, c)

if no_graph:
return
num_imus = len(data.IMUs())

generate_tempcal_gyro_figures(log_parm, figpath, data, c, clog, num_imus)

if progress_callback:
progress_callback(290)

generate_tempcal_accel_figures(log_parm, figpath, data, c, clog, num_imus)

if progress_callback:
progress_callback(300)

pyplot.show()

def generate_calibration_file(outfile, online, progress_callback, data, c): # pylint: disable=too-many-locals
clog = c
c = Coefficients()

if progress_callback:
progress += 10
progress = 220
progress_callback(progress)
progress_delta = 60 / (len(data.IMUs()) * len(AXES))
with open(outfile, "w", encoding='utf-8') as calfile:
Expand Down Expand Up @@ -503,12 +521,10 @@ def IMUfit(logfile, outfile, # pylint: disable=too-many-locals, too-many-bra
calfile.write(params)

print(f"Calibration written to {outfile}")
return c, clog

if no_graph:
return
def generate_tempcal_gyro_figures(log_parm, figpath, data, c, clog, num_imus): # pylint: disable=too-many-arguments
_fig, axs = pyplot.subplots(len(data.IMUs()), 1, sharex=True)

num_imus = len(data.IMUs())
if num_imus == 1:
axs = [axs]

Expand Down Expand Up @@ -536,12 +552,10 @@ def IMUfit(logfile, outfile, # pylint: disable=too-many-locals, too-many-bra
axs[imu].legend(loc='upper left')
axs[imu].set_title(f'IMU[{imu}] Gyro (deg/s)')

if progress_callback:
progress_callback(290)

if figpath:
_fig.savefig(os.path.join(figpath, 'tempcal_gyro.png'))

def generate_tempcal_accel_figures(log_parm, figpath, data, c, clog, num_imus): # pylint: disable=too-many-arguments
_fig, axs = pyplot.subplots(num_imus, 1, sharex=True)
if num_imus == 1:
axs = [axs]
Expand Down Expand Up @@ -576,11 +590,6 @@ def IMUfit(logfile, outfile, # pylint: disable=too-many-locals, too-many-bra
if figpath:
_fig.savefig(os.path.join(figpath, 'tempcal_acc.png'))

if progress_callback:
progress_callback(300)

pyplot.show()


def main():
parser = ArgumentParser(description=__doc__)
Expand All @@ -600,5 +609,6 @@ def main():

IMUfit(args.log, args.outfile, args.no_graph, args.log_parm, args.online, args.tclr, None, None)


if __name__ == "__main__":
main()
14 changes: 9 additions & 5 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Quick start guide
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

## 1. Install *ArduPilot Methodic Configurator* software on a PC or Mac

Expand Down Expand Up @@ -35,14 +40,14 @@
1. Open the *ArduPilot Methodic Configurator* software.
1. The software should now automatically detect and connect to your flight controller.
![AMC FC info and parameter download](images/App_screenshot_FC_info_and_param_download.png)
1. Select the vehicle template that better resembles your own vehicle.
1. Select the vehicle template that better resembles your vehicle.
![AMC template selection1](images/App_screenshot_Vehicle_directory1.png)
![AMC template selection2](images/App_screenshot_Vehicle_overview.png)
1. Give a name to your vehicle.
![AMC new vehicle name](images/App_screenshot_Vehicle_directory2.png)
1. Press *Create vehicle configuration from template*.
![AMC new vehicle create](images/App_screenshot_Vehicle_directory3.png)
1. Edit all the components of your vehicle to match your own in the *vehicle Component Editor* window.
1. Edit all the components of your vehicle to match your own in the *Vehicle Component Editor* window.
![AMC component editor](images/App_screenshot_Component_Editor.png)
1. Press *Save data and start configuration*.
1. The application will validate your input.
Expand All @@ -66,7 +71,6 @@ Now do this in a loop until the software automatically closes or you are asked t
- Press *Upload selected params to FC, and advance to next param file* (marked with the big red number 7),
- Repeat until the program automatically closes.


## 6. Use the *ArduPilot Methodic Configurator* software after having created a vehicle from template

1. Connect the flight controller to the computer using a USB cable.
Expand All @@ -82,5 +86,5 @@ double-click and step inside the directory that you want to use, not just select
1. Press *Save data and start configuration*.
1. You should now see the *Parameter file editor and uploader* window.
![AMC parameter file editor and uploader](images/App_screenshot2.png)
1. Proceed as explained on [section 5](#5-configure-the-vehicles-parameters-in-a-traceable-way)
Congratulations your flight controller is now fully configured in the safest and fastest way publicly know.
1. Proceed as explained in [section 5](#5-configure-the-vehicles-parameters-in-a-traceable-way)
Congratulations your flight controller is now fully configured in the safest and fastest way publicly known.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# ArduPilot Methodic Configurator
# Everyone should be able to configure ArduPilot for their vehicles

<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

| Lint | Quality | Test | Deploy | Maintain |
| ---- | ------- | ---- | ------ | -------- |
| [![Pylint](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pylint.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pylint.yml) | [![REUSE status](https://api.reuse.software/badge/github.com/ArduPilot/MethodicConfigurator)](https://api.reuse.software/info/github.com/ArduPilot/MethodicConfigurator) | [![Python unit-tests](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/unit-tests.yml) | [![pages-build-deployment](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pages/pages-build-deployment) | [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/ArduPilot/MethodicConfigurator.svg)](http://isitmaintained.com/project/ArduPilot/MethodicConfigurator) |
| [![Pylint](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pylint.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pylint.yml) | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/720794ed54014c58b9eaf7a097a4e98e)](https://app.codacy.com/gh/amilcarlucas/MethodicConfigurator/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) | [![Python unit-tests](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/unit-tests.yml) | [![pages-build-deployment](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/pages/pages-build-deployment) | [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/ArduPilot/MethodicConfigurator.svg)](http://isitmaintained.com/project/ArduPilot/MethodicConfigurator) |
| [![test Python cleanliness](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/ruff.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/ruff.yml) | [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9101/badge)](https://www.bestpractices.dev/projects/9101) | [![Pytest unittests](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/unittests.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/unittests.yml) | [![Upload MethodicConfigurator Package](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/python-publish.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/python-publish.yml) | [![Percentage of issues still open](http://isitmaintained.com/badge/open/ArduPilot/MethodicConfigurator.svg)](http://isitmaintained.com/project/ArduPilot/MethodicConfigurator) |
| | [![Known Vulnerabilities](https://snyk.io/test/github/amilcarlucas/MethodicConfigurator/badge.svg)](https://snyk.io/test/github/amilcarlucas/MethodicConfigurator) | [![codecov](https://codecov.io/github/amilcarlucas/MethodicConfigurator/graph/badge.svg?token=76P928EOL2)](https://codecov.io/github/amilcarlucas/MethodicConfigurator) | [![Windows Build](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/windows_build.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/windows_build.yml) |
| | [![Code Climate](https://codeclimate.com/github/amilcarlucas/MethodicConfigurator.png)](https://codeclimate.com/github/amilcarlucas/MethodicConfigurator) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/30346/badge.svg)](https://scan.coverity.com/projects/ardupilot-methodic-configurator) | [![Github All Releases](https://img.shields.io/github/downloads/ArduPilot/MethodicConfigurator/total.svg)]() | |


| | [![Known Vulnerabilities](https://snyk.io/test/github/amilcarlucas/MethodicConfigurator/badge.svg)](https://snyk.io/test/github/amilcarlucas/MethodicConfigurator) | [![codecov](https://codecov.io/github/amilcarlucas/MethodicConfigurator/graph/badge.svg?token=76P928EOL2)](https://codecov.io/github/amilcarlucas/MethodicConfigurator) | [![Windows Build](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/windows_build.yml/badge.svg)](https://github.com/ArduPilot/MethodicConfigurator/actions/workflows/windows_build.yml) | |
| | [![Code Climate](https://codeclimate.com/github/amilcarlucas/MethodicConfigurator.png)](https://codeclimate.com/github/amilcarlucas/MethodicConfigurator) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/30346/badge.svg)](https://scan.coverity.com/projects/ardupilot-methodic-configurator) | [![Github All Releases](https://img.shields.io/github/downloads/ArduPilot/MethodicConfigurator/total.svg)](https://github.com/ArduPilot/MethodicConfigurator/releases) | |

Amilcar Lucas's ArduPilot Methodic Configurator is a Python tool that implements a [clear and proven configuration sequence of ArduPilot of drones](https://discuss.ardupilot.org/t/how-to-methodically-tune-almost-any-multicopter-using-arducopter-4-4-x/110842/1).

Expand Down Expand Up @@ -59,4 +62,4 @@ To use and develop this software you must obey the [ArduPilot Methodic Configura
## License

This project is licensed under the [GNU General Public License v3.0](LICENSE.md).
It builds upon other [opensource software packages](credits/CREDITS.md)
It builds upon other [open-source software packages](credits/CREDITS.md)
5 changes: 5 additions & 0 deletions USERMANUAL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# ArduPilot Methodic Configurator User Manual
<!--
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
-->

## Overview

Expand Down
Loading

0 comments on commit dd41bc2

Please sign in to comment.