23 Commits

Author SHA1 Message Date
Oleg Kalachev
52819e403b Major rework of rc subsystem
Implement channels mapping calibration.
Store mapping in parameters.
Get rid of `controls` array and store control inputs in `controlRoll`, `controlPitch`, ... variables.
Move `channels` variable to rc.ino, channels are not involved when controled using mavlink.
'Neutral' values are renamed to 'zero' - more precise naming.
`controlsTime` is renamed to `controlTime`.
Use unsigned values for channels.
Make channel values in simulation more alike to real world: unsigned values in range [1000, 2000].
Send RC_CHANNELS_RAW instead of RC_CHANNELS_SCALED via mavlink
Don't send channels data via mavlink if rc is not used
2025-07-14 12:01:29 +03:00
Oleg Kalachev
5bf2e06c5a Use natural order of ino files includes in simulation
In Arduino, ino files are included in alphabetical order.
Cleanup unused function declarations in simulation, add missing.
Rename flu to frd function to match the code style.
2025-02-28 19:06:58 +03:00
Oleg Kalachev
149c62568f Refactor CLI submodule
Move command parsing to doCommand
Parse command with splitString instead of stringToken
Trim commands
Move cliTestMotor to the bottom
Rename parseInput to handleInput, which is more clear
Move motor test function to motors.ino
2025-02-17 15:51:58 +03:00
Oleg Kalachev
821e6b105e Make channels definition to rc.ino
It's also planned to parametrize them later
2025-01-10 09:37:48 +03:00
Oleg Kalachev
85172cdcc8 Make util module header instead of .ino-file 2025-01-10 06:51:14 +03:00
Oleg Kalachev
404ceed851 Make motor indexes definition const int and move them to motors.ino
Remove motor indexes definitions from flix.ino
Add motors.ino to simulation code and implement required mocks
2025-01-09 11:14:18 +03:00
Oleg Kalachev
8d7a4595f5 Rename flushParameters to more clear syncParameters 2024-12-26 01:14:26 +03:00
Oleg Kalachev
ae349fb73c Implement parameters subsystem
* Unified parameters storage.
* Store parameters in flash on the hardware.
* Store parameters in text file in simulation.
* Work with parameters in command line.
* Support parameters in MAVLink for working with parameters in QGC.
2024-12-23 13:00:02 +03:00
Oleg Kalachev
ec832d4e37 Implement RC fail-safe 2024-11-04 11:51:17 +03:00
Oleg Kalachev
a94687bd56 Keep the t variable monotonic in the simulation
Otherwise it causes stopping sending MAVLink and other bugs
2024-10-23 09:36:54 +03:00
Oleg Kalachev
abcc9b96de Use FLU as the main coordinate system instead of FRD
Corresponding to the IMU orientation in the new version
2024-10-23 09:30:49 +03:00
Oleg Kalachev
627233f862 Minor updates 2024-07-25 02:44:47 +03:00
Oleg Kalachev
1119c77cca Remove unneeded abs for motors thrust in simulation 2024-05-24 14:47:26 +03:00
Oleg Kalachev
41a9a95747 Transfer gyro low pass filter to estimate.ino
Separate raw gyro data and filtered rates to different variables
2024-04-20 14:52:01 +03:00
Oleg Kalachev
f718af7f0e Support MAVLink usage in simulation 2024-01-31 12:10:18 +03:00
Oleg Kalachev
6b52ad562b Minor const clarification 2024-01-31 12:00:23 +03:00
Oleg Kalachev
ed6d09061b Rename RC_CHANNEL_AUX to RC_CHANNEL_ARMED 2024-01-19 05:19:41 +03:00
Oleg Kalachev
48ea797a47 Make simulator read RC through real drone code 2024-01-06 00:09:29 +03:00
Oleg Kalachev
f520b57abe Implement RC calibration, common for the real drone and the simulation 2024-01-02 11:54:09 +03:00
Oleg Kalachev
78f3f6e3b3 More simulation code minor updates 2023-12-29 19:10:37 +03:00
Oleg Kalachev
d2296fea76 Change C++ code style: put curly brace on the same line 2023-12-29 18:56:25 +03:00
Oleg Kalachev
645b148564 Cleanup simulation code, remove debug model showing current attitude estimation 2023-12-29 18:45:19 +03:00
Oleg Kalachev
c58a16e4df More clear file name for simulation plugin, cleanup in CMakeLists 2023-12-29 13:33:03 +03:00