You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]>
4
4
5
5
SPDX-License-Identifier: GPL-3.0-or-later
6
6
-->
7
7
8
-
Before we decided on a software architecture or programming language or toolkit we gathered software requirements as presented below.
9
-
10
-
## Software requirements
11
-
12
-
The goal of this software is to automate some of the tasks involved in configuring and tuning an ArduPilot-based vehicle.
13
-
The method it follows is explained in the [How to methodically tune any ArduCopter](https://ardupilot.github.io/MethodicConfigurator/TUNING_GUIDE_ArduCopter).
14
-
This list of functionalities provides a comprehensive overview of the software's capabilities and can serve as a starting point for further development and refinement.
15
-
16
-
### 1. Parameter Configuration Management
17
-
18
-
- The software must allow users to view and manage drone parameters.
19
-
- Users should be able to select an intermediate parameter file from a list of available files.
20
-
- The software must display a table of parameters with columns for the parameter name, current value, new value, unit, upload to flight controller, and change reason.
8
+
The goal *ArduPilot methodic Configurator* software is to automate some of the tasks involved in configuring and tuning ArduPilot-based vehicles.
9
+
To develop the software the [standard V-Model software development method](https://en.wikipedia.org/wiki/V-model_(software_development)) was first used.
10
+
It was augmented with [DevOps](https://en.wikipedia.org/wiki/DevOps) and [CI/CD automation](https://en.wikipedia.org/wiki/CI/CD) practices at a later stage.
11
+
12
+
## V-model
13
+
14
+
### Requirements analysis
15
+
16
+
We collected and analyzed the needs of the ArduPilot users:
17
+
18
+
- guidelines on how to correctly build the vehicle, many users are not aware of the hardware basics.
19
+
- a non-trial and error approach to set the [1300 ArduPilot parameters](https://ardupilot.org/copter/docs/parameters.html)
20
+
- a clear sequence of steps to take to configure the vehicle
21
+
- a way to save and load the configuration for later use
22
+
- a way to document how decisions where made during the configuration process
23
+
- to be able to not repeat errors
24
+
- to be able to reproduce the configuration on another similar bit different vehicle
25
+
- to understand why decisions where made and their implications
26
+
27
+
Then we developed, documented and tested the *clear sequence of steps to take to configure the vehicle* in the
28
+
[How to methodically tune any ArduCopter](https://ardupilot.github.io/MethodicConfigurator/TUNING_GUIDE_ArduCopter) guide.
29
+
Once that was mostly done we proceeded with *system design* the next step of the V-model.
30
+
31
+
### System design
32
+
33
+
To automate the steps and processes in the [How to methodically tune any ArduCopter](https://ardupilot.github.io/MethodicConfigurator/TUNING_GUIDE_ArduCopter) guide
34
+
the following system design requirements were derived:
35
+
36
+
#### 1. Parameter Configuration Management
37
+
38
+
- The software must allow users to view parameter values
39
+
- The software must allow users to change parameter values
40
+
- For each step in the configuration sequence there must be a "partial/intermediate" parameter file
41
+
- The "partial/intermediate" parameter files must have meaningful names
42
+
- The sequence of the "partial/intermediate" parameter files must be clear
43
+
- Users should be able to upload all parameters from a "partial/intermediate" parameter file to the flight controller and advance to the next intermediate parameter file.
44
+
- Users should be able to upload a subset of parameters from a "partial/intermediate" parameter file to the flight controller and advance to the next intermediate parameter file.
45
+
- Users should be able to select a "partial/intermediate" parameter file from a list of available files and select the one to be used.
46
+
- The software must display a table of parameters with columns for:
47
+
- the parameter name,
48
+
- current value,
49
+
- new value,
50
+
- unit,
51
+
- upload to flight controller,
52
+
- and change reason.
21
53
- The software must validate the new parameter values and handle out-of-bounds values gracefully, reverting to the old value if the user chooses not to use the new value.
22
54
- The software must save parameter changes to both the flight controller and the intermediate parameter files
23
55
24
-
### 2. Communication Protocols
56
+
####2. Communication Protocols
25
57
26
-
- The software must support communication with the drone's flight controller using MAVlink and FTP over MAVLink protocols.
27
-
- The software must handle the encoding and decoding of messages according to the specified protocols.
28
-
- The software must allow users to tune drone parameters.
29
-
- Users should be able to upload selected parameters to the flight controller and advance to the next intermediate parameter file.
30
-
- The software must provide a mechanism to reset the ArduPilot if required by the changes made to the parameters.
31
-
- The software must make sure the parameter change communication worked by re-downloading and validating that the parameter changed on the vehicle.
58
+
- The software must support communication with the drone's flight controller using [MAVlink](https://mavlink.io/en/).
59
+
- Use either [parameter protocol](https://mavlink.io/en/services/parameter.html) or [FTP-over-MAVLink](https://mavlink.io/en/services/ftp.html) protocols.
60
+
- The software must automatically reset the ArduPilot if required by the changes made to the parameters.
61
+
- parameters ending in "_TYPE", "_EN", "_ENABLE", "SID_AXIS" require a reset after being changed
62
+
- The software must automatically validate if the parameter was correctly uploaded to the flight controller
63
+
- It must re-upload any parameters that failed to be uploaded correctly
64
+
- The software must manage the connection to the flight controller, including establishing, maintaining, and closing the connection.
65
+
- Users should be able to reconnect to the flight controller if the connection is lost.
32
66
33
-
###4. User Interface
67
+
#### 3. User Interface
34
68
35
69
- The software must provide a user-friendly interface with clear navigation and controls.
36
70
- The interface must be responsive and adapt to different screen sizes and resolutions.
37
71
- Users should be able to toggle between showing only changed parameters and showing all parameters.
38
-
- The software must provide feedback to the user, such as success or error messages, when performing actions like uploading parameters to the flight controller.
39
72
- Users should be able to skip to the next parameter file without uploading changes.
40
73
- The software must ensure that all changes made to entry widgets are processed before proceeding with other actions, such as uploading parameters to the flight controller.
41
74
- Read-only parameters are displayed in red, Sensor Calibrations are displayed in yellow and non-existing parameters in blue
42
75
- Users should be able to edit the new value for each parameter directly in the table.
43
76
- Users should be able to edit the reason changed for each parameter directly in the table.
44
-
- The software must provide tooltips for each parameter to explain their purpose and usage.
77
+
- The software must perform efficiently, with minimal lag or delay in response to user actions.
45
78
46
-
###5. Documentation and Help
79
+
#### 4. Documentation and Help
47
80
48
81
- The software must include comprehensive documentation and help resources.
49
-
- Users should be able to access a blog post or other resources for more information on the software and its usage.
82
+
- The software must provide tooltips for each GUI widget.
83
+
- The software must provide tooltips for each parameter to explain their purpose and usage.
84
+
- Users should be able to access the blog post and other resources for more information on the software and its usage.
50
85
51
-
###6. Error Handling and Logging
86
+
#### 5. Error Handling and Logging
52
87
88
+
- The software must provide feedback to the user, such as success or error messages, after each action.
53
89
- The software must handle errors gracefully and provide clear error messages to the user.
54
-
- The software must log events and errors for debugging and auditing purposes.
55
-
56
-
### 7. Connection Management
90
+
- The software must log events and errors for debugging and auditing purposes to the console.
57
91
58
-
- The software must manage the connection to the flight controller, including establishing, maintaining, and closing the connection.
59
-
- Users should be able to reconnect to the flight controller if the connection is lost.
60
-
61
-
### 8. Parameter File Management
92
+
#### 6. Parameter File Management
62
93
63
94
- The software must support the loading and parsing of parameter files.
64
-
- Users should be able to navigate through different parameter files and select the one to be used.
65
95
- Comments are first-class citizens and are preserved when reading/writing files
66
96
- The software must write at the end of the configuration the following summary files:
@@ -121,16 +160,57 @@ They can also be exchanged, for instance, [tkinter-frontend](https://docs.python
121
160
In the future, we might port the entire application into a client-based web application.
122
161
That way the users would not need to install the software and will always use the latest version.
123
162
163
+
### Module design
164
+
165
+
To assure code quality we decided to use Microsoft VS code with a [lot of extensions](SetupDeveloperPc.bat) to lint the code as you type.
166
+
We use git [pre-commit](https://pre-commit.com/) hooks to [check the code](.pre-commit-config.yaml) before it is committed to the repository.
167
+
168
+
### Unit testing
169
+
170
+
We use [unittest](https://docs.python.org/3/library/unittest.html) to write unit tests for the code.
171
+
The tests are easy to run on the command line or in VS code. Tests and coverage report are run automatically in the github CI pipeline.
172
+
173
+
### Integration testing
174
+
175
+
The four different sub-applications are first tested independently.
176
+
177
+
- flight controller connection GUI
178
+
- vehicle configuration directory selection GUI
179
+
- vehicle component editor GUI
180
+
- parameter editor and uploader GUI
181
+
182
+
Only after each one performs 100% as expected, they are integrated and tested together.
183
+
This speeds up the development process.
184
+
185
+
### System testing
186
+
187
+
Here the integrated application was tested against the system requirements defined above.
188
+
The tests were conducted on windows and linux machines using multiple different flight controllers and firmware versions.
189
+
The software is automatically build and distributed using the github CD pipeline.
190
+
191
+
### Acceptance testing
192
+
193
+
The software was tested by multiple users with different skill levels, languages, flight controller and backgrounds.
194
+
The feedback was used to improve the user interface and user experience.
195
+
The software is ready for production use since November 2024.
196
+
197
+
## DevOps
198
+
199
+
The software is feature complete and stable with a user base of hundreds of users, we switched from the V-Model to DevOps development process on November 2024.
200
+
This provides faster response to requirements changes and additions.
201
+
124
202
## Adding a translation
125
203
126
-
To add a new translation language to the Ardupilot Methodic Configurator, follow the steps below. This process involves creating a new language folder in the locale directory and generating the necessary translation files. You will use the `create_pot_file.py` script to extract the strings that need translation and create a `.pot` file, which serves as a template for the translation.
204
+
To add a new translation language to the Ardupilot Methodic Configurator, follow the steps below.
205
+
This process involves creating a new language folder in the locale directory and generating the necessary translation files.
206
+
You will use the `create_pot_file.py` script to extract the strings that need translation and create a `.pot` file, which serves as a template for the translation.
127
207
128
208
### 1. Set Up Your Locale Directory
129
209
130
210
Navigate to the `locale` directory inside your project:
131
211
132
212
```bash
133
-
cdMethodicConfigurator/locale
213
+
cdardupilot_methodic_configurator/locale
134
214
```
135
215
136
216
### 2. Create a New Language Directory
@@ -158,7 +238,7 @@ Ensure you are in the root directory of your project, and execute the following
158
238
python create_pot_file.py
159
239
```
160
240
161
-
This will create a file named `MethodicConfigurator.pot` inside the `MethodicConfigurator/locale` directory.
241
+
This will create a file named `ardupilot_methodic_configurator.pot` inside the `ardupilot_methodic_configurator/locale` directory.
162
242
163
243
### 4. Create a New PO File
164
244
@@ -167,7 +247,7 @@ Inside your newly created language directory, create a new `.po` file using the
Open the `MethodicConfigurator.po` file in a text editor or a specialist translation tool (e.g., [Poedit](https://poedit.net/)). You will see the extracted strings, which you can begin translating.
271
+
Open the `ardupilot_methodic_configurator.po` file in a text editor or a specialist translation tool (e.g., [Poedit](https://poedit.net/)). You will see the extracted strings, which you can begin translating.
192
272
193
273
Each entry will look like this:
194
274
@@ -216,7 +296,7 @@ Make sure you have `msgfmt` installed, which is part of the *GNU gettext* packag
216
296
217
297
### 8. Test the New Language
218
298
219
-
Now add the language to the end of the `LANGUAGE_CHOICES` array in the `MethodicConfigurator/internationalization.py` file.
299
+
Now add the language to the end of the `LANGUAGE_CHOICES` array in the `ardupilot_methodic_configurator/internationalization.py` file.
0 commit comments