38602 Commits

Author SHA1 Message Date
Julian Oes
9cbfa2ca95 manual_control: ORBIT and PRECLAND not supported
ORBIT and PRECLAND are not actually possible on the flight mode switch.
2021-11-09 16:05:25 +01:00
Julian Oes
2e9edfcd89 commander: only override according to param
This got lost in the refactor earlier.
2021-11-09 16:05:25 +01:00
Julian Oes
56b2b81600 manual_control: use filter to check user override
Instead of only looking at the diff between two RC samples to decide
whether a user wants to override, we now look at the filtered diff over
one second. This should be more robust to RC sent at various or varying
rates.
2021-11-09 16:05:25 +01:00
Julian Oes
97d01f200e commander: move manual_control and switches out
This moves the remaining handling of the manual control stuff out
of commander. All communication between manual control now goes through
vehicle commands, and the landing gear topic.
2021-11-09 16:05:25 +01:00
Julian Oes
e49b596edc commander: add desired main state
This is an intermediate solution to carry forward the initial state of
the mode slot. Basically, it allows that we start up in Stabilized but
switch to POSCTL as soon we have the required GPS.
2021-11-09 16:05:25 +01:00
Julian Oes
b6af068f25 commander: always reset posvel validity
I assume reseting posvel validity is ok for any case, not just all cases
except manual, acro, stabilized.
2021-11-09 16:05:25 +01:00
Julian Oes
52563264e6 commander: move valid mission check inside
I think it makes more sense to move this check inside of
main_state_transition.
2021-11-09 16:05:25 +01:00
Julian Oes
916ffef04c manual_control: send initial mode in the beginning
In order for commander to know the desired mode we need to send the
initial position of the mode slot.
2021-11-09 16:05:25 +01:00
Julian Oes
a91fa7f3c1 commander: only move to POSCTL when armed
I don't think we want to switch to POSCTL when the sticks are moved when
armed.
2021-11-09 16:05:25 +01:00
Julian Oes
66b069e788 commander: move main_state_transition out
This is a first step to having a desired main state.
2021-11-09 16:05:25 +01:00
Julian Oes
e2e908d0fc mavlink: remove unused methods 2021-11-09 16:05:25 +01:00
Julian Oes
97aa06cc19 commander: move switch handling to manual_control 2021-11-09 16:05:25 +01:00
Julian Oes
08e58a44e9 Fix style 2021-11-09 16:05:25 +01:00
Julian Oes
71d6aa913d manual_control: starting to implement switches 2021-11-09 16:05:25 +01:00
Julian Oes
ac121c676a commander: check for valid flag for manual_control 2021-11-09 16:05:25 +01:00
Julian Oes
cda6524421 manual_control: move override detection
This also removes the option to ignore throttle for the override
detection as it's not really required anymore.
2021-11-09 16:05:25 +01:00
Julian Oes
1c15cc11d8 manual_control: implement (dis)arming via command 2021-11-09 16:05:25 +01:00
Julian Oes
8876af9150 manual_control: add instance to selector
This instance is then used to schedule the callback for the
subscription.
2021-11-09 16:05:25 +01:00
Julian Oes
14eb656a59 rc_update: use snake_case for namespace name 2021-11-09 16:05:25 +01:00
Julian Oes
6e8ccf6a45 rc_update: rename update method
This reflects better what it actually does.
2021-11-09 16:05:25 +01:00
Julian Oes
723db8bf2a manual_control: add selector class [WIP]
This adds a selector class with unit tests.
The idea is to have a valid flag in manual_control_septoint and set that
according to the selection and/or timeout of manual_control_inputs.
2021-11-09 16:05:25 +01:00
Julian Oes
eeb7682fd9 ROMFS: start manual_control for SITL 2021-11-09 16:05:25 +01:00
Daniel Agar
2d816e0b3e [WIP] manual_control selector hacks 2021-11-09 16:05:25 +01:00
Daniel Agar
e18cf3da3e sensors/vehicle_imu: use WelfordMean for online mean and variance 2021-11-09 15:19:35 +01:00
Daniel Agar
a8c3bcca32 boards: disable CONFIG_STM32H7_SPI_DMATHRESHOLD 2021-11-08 19:20:47 -05:00
Daniel Agar
cb34ff1292 posix-configs/SITL/init/test/test_imu_filtering enable gyro dynamic notch filtering by default 2021-11-08 19:14:32 -05:00
Daniel Agar
e0d9ccdc18 sensors/vehicle_angular_velocity: small FFT notch update simplification 2021-11-08 19:14:32 -05:00
Daniel Agar
47afab62e7 gyro_fft: limit noise floor to configured range (IMU_GYRO_FFT_MIN/MAX) 2021-11-08 19:14:32 -05:00
Daniel Agar
dd3e0b723a gyro_fft: add IMU_GYRO_FFT_SNR parameter 2021-11-08 19:14:32 -05:00
Matthias Grob
6fab6242db setup/python requirements: add future module
which is a requirement for MAVLink header generation.
Found on Ubuntu 20.04 Python 3.
2021-11-08 17:05:30 +01:00
Silvan Fuhrer
b216cddf49 state_machine_helper: add place holder in array nav_state_names for removed LANDGPSFAIL mode
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-08 13:42:55 +01:00
JaeyoungLim
031f7f831b
Fixedwing Pos Control: Handle vehicle transition waypoints outside controllers (#18503)
* Handle VTOL transition waypoints outside FW auto control modes
2021-11-08 11:21:08 +01:00
Daniel Agar
66ab7e50df
github actions increase NuttX compile ccache limit slightly 2021-11-07 20:37:58 -05:00
Daniel Agar
3b68f8e510 Tools/check_submodules.sh revert attempted submodule improvements
- this wasn't helping break out of submodule issues
2021-11-07 20:36:47 -05:00
Daniel Agar
4627f5514e boards: holybro_kakutef7_default disable load_mon to save flash 2021-11-07 20:36:47 -05:00
Jaeyoung-Lim
6a2ebfc0cc Handle setpoint types properly for fixedwing position control
Handle setpoint types properly for fixedwing position control
2021-11-07 19:21:00 -05:00
Daniel Agar
f43adaeeb5
Tools/check_submodules.sh disable parallel jobs
- this is already run separately for each submodule (potentially in parallel)
2021-11-07 18:12:30 -05:00
Silvan Fuhrer
dbd9b88bea FW position controller: only allow switching to AUTO_ALTITDUE or AUTO_CLIMBRATE if pos_sp_curr_valid
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-07 23:31:21 +01:00
Daniel Agar
2f8cb5a1c2 mavlink: initial support for MAG_CAL_REPORT stream 2021-11-07 16:03:34 -05:00
Daniel Agar
24b00317b5
Tools/check_submodules.sh attempt update before sync to handle changes 2021-11-07 16:00:13 -05:00
Viktor Vladic
5b3e1a2347
boards: add MatekH743-slim support 2021-11-07 15:39:50 -05:00
JaeyoungLim
cda7c6ceaa
Enable offboard actuator setpoints 2021-11-07 15:38:42 -05:00
Guilherme Lawless
47a191489e
cmake: sitl_gazebo build use memory information from the system to estimate the parallel jobs
Using cmake_host_system_information, grabs AVAILABLE_PHYSICAL_MEMORY and adds another job for every 1.5GB of available memory.

This is tested on a single system with 16 logical cores and 16GB RAM (~11.5GB available, reported correctly by cmake).
2021-11-07 15:37:48 -05:00
Daniel Agar
68026eadeb
save significant IMU bias changes learned by the EKF
* ekf2: make publishing of learned accel biases more robust
* ekf2: reset accel bias if calibration updated
* msg: add separate accel and gyro calibration counters
* ekf2: use separate accel and gyro calibration counters
* ekf2: rework logic to reset biases when calibration counters increment
* sensors: add saving of learned accel biases
* ekf2: generalized saving accel/gyro/mag in flight sensor calibration
* boards: holybro kakutef7 disable systemcmds/perf and systemcmds/top to save flash

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2021-11-07 15:34:27 -05:00
Jacob Crabill
5969508fa7
mavlink: cmake generate mavlink headers at build time
- mavlink/mavlink is now directly included as a submodule instead of the generated mavlink/c_library_v2
 - this also switches to mavlink development.xml by default
2021-11-05 23:01:38 -04:00
Julian Oes
88489ae8bd mavlink: Check target for mavlink shell
The SERIAL_CONTROL MAVLink message now contains a target_system and
target_component field that we should check.

Without this we might be answering to a command on the network that is
meant for another system.
2021-11-05 23:48:44 +01:00
David Sidrane
96101a9c11 NuttX backports of imxrt dcache fixes to support WB & USB 2021-11-05 13:50:02 -04:00
David Sidrane
af6bedaded nxp_fmurt1062:Needs pwm_out 2021-11-05 13:50:02 -04:00
David Sidrane
ff43923567 nxp_fmurt1062-v1:Use Write Back Dcache 2021-11-05 13:50:02 -04:00
David Sidrane
dedad87e82 nxp_fmurt1062-v1:Force no no-unaligned-access
This results in a load saving (no dcache) of 16.82% at a cost
  of 0.03% Flash, .07% XIP Flash and .45% SRAM

Forced Alighment

With: -mno-unaligned-access

Memory region         Used Size  Region Size  %age Used
           flash:      606568 B         7 MB      8.26%
        flashxip:      622920 B         1 MB     59.41%
            sram:      640848 B       856 KB     73.11%
            itcm:          0 GB         0 GB
            dtcm:          0 GB       128 KB      0.00%

 PID COMMAND                   CP
   0 Idle Task                   87640 20.047   204/  748   0 (  0)  READY  3
   1 hpwork                          0  0.000   332/ 1784 249 (249)  w:sig  3
   2 lpwork                         26  0.008   780/ 1616  50 ( 50)  w:sig  4
   3 init                            0  0.000  1980/ 2928 100 (100)  w:sem  3
   4 wq:manager                      0  0.000   508/ 1256 255 (255)  w:sem  4
 327 navigator                     910  0.204  1124/ 1832 105 (105)  READY  6
  23 wq:lp_default                3479  0.795  1252/ 1920 205 (205)  READY  4
  30 wq:hp_default               23554  5.415  1332/ 1904 237 (237)  READY  4
  47 dataman                         0  0.000   820/ 1208  90 ( 90)  w:sem  4
  57 wq:I2C1                     26849  6.190  1060/ 2336 246 (246)  w:sem  4
  60 wq:I2C2                     24045  5.440   732/ 2336 245 (245)  w:sem  4
  86 wq:SPI1                     47127 10.804  1352/ 2336 253 (253)  w:sem  4
  91 wq:I2C3                      1935  0.436   980/ 2336 244 (244)  w:sem  4
 101 wq:SPI3                      6932  1.585  1028/ 2336 251 (251)  w:sem  4
 237 wq:nav_and_controllers      16743  3.832  1236/ 2240 242 (242)  w:sem  4
 248 wq:rate_ctrl                 9008  2.074  1572/ 1952 255 (255)  w:sem  4
 250 wq:INS0                     37182  8.450  4372/ 6000 241 (241)  w:sem  4
 264 commander                   29395  6.732  1260/ 3224 140 (140)  READY  5
 287 mavlink_if0                 60513 13.828  1876/ 2728 100 (100)  READY  4
 294 mavlink_rcv_if0              5946  1.387  1292/ 4560 175 (175)  READY  4
 307 wq:UART5                     3345  0.770   844/ 1632 229 (229)  READY  4
 370 log_writer_file                 0  0.000   372/ 1176  60 ( 60)  w:sem  3
 369 logger                       2121  0.484  2468/ 3648 230 (230)  READY  3
 393 top                         37523  8.641  3060/ 4080 237 (237)  RUN    3

Processes: 24 total, 10 running, 14 sleeping
CPU usage: 77.08% tasks, 2.87% sched, 20.05% idle
DMA Memory: 5120 total, 1024 used 1024 peak
Uptime: 441.946s total, 87.640s idle

Allow Un-Alighment
With Out: -mno-unaligned-access
Memory region         Used Size  Region Size  %age Used
           flash:      604008 B         7 MB      8.23%   8.26%    +0.03

        flashxip:      622240 B         1 MB     59.34%  59.41%    +0.07
            sram:      636752 B       856 KB     72.64%  73.11%    +0.45
            itcm:          0 GB         0 GB
            dtcm:          0 GB       128 KB      0.00%  0.00%

 PID COMMAND                   CPU(ms) CPU(%)  USED/STACK PRIO(BASE) STATE FD
   0 Idle Task                    2418  3.190   264/  748   0 (  0)  READY  3
   1 hpwork                          0  0.000   332/ 1784 249 (249)  w:sig  3
   2 lpwork                         12  0.004   852/ 1616  50 ( 50)  w:sig  3
   3 init                            0  0.000  1932/ 2928 100 (100)  w:sem  3
   4 wq:manager                      0  0.000   548/ 1256 255 (255)  w:sem  4
 327 navigator                      22  0.203  1052/ 1832 105 (105)  READY  6
  23 wq:lp_default                  83  0.743  1252/ 1920 205 (205)  READY  4
  30 wq:hp_default                 637  5.886  1332/ 1904 237 (237)  READY  4
  47 dataman                         0  0.000   820/ 1208  90 ( 90)  w:sem  4
  57 wq:I2C1                       162  1.063  1060/ 2336 246 (246)  w:sem  4
  60 wq:I2C2                        98  0.500   732/ 2336 245 (245)  w:sem  4
  86 wq:SPI1                      1166 10.771  1352/ 2336 253 (253)  w:sem  4
  91 wq:I2C3                        48  0.437  1060/ 2336 244 (244)  w:sem  4
 101 wq:SPI3                       178  1.653  1028/ 2336 251 (251)  w:sem  4
 237 wq:nav_and_controllers        410  3.781  1324/ 2240 242 (242)  w:sem  4
 248 wq:rate_ctrl                  222  2.050  1572/ 1952 255 (255)  w:sem  4
 250 wq:INS0                       940  8.691  4372/ 6000 241 (241)  w:sem  4
 264 commander                     753  6.475  1472/ 3224 140 (140)  READY  5.03
 287 mavlink_if0                  1440 13.973  1780/ 2728 100 (100)  READY  4
 294 mavlink_rcv_if0               139  1.304  1276/ 4560 175 (175)  READY  4
 307 wq:UART5                       83  0.785   828/ 1632 229 (229)  READY  4
 370 log_writer_file                 0  0.000   372/ 1176  60 ( 60)  w:sem  3
 369 logger                         54  0.493  2468/ 3648 230 (230)  READY  3
 393 top                          1053 10.015  3060/ 4080 237 (237)  RUN    3
 396 mavlink_rcv_if1               166  1.608  1380/ 4560 175 (175)  READY  4
 395 mavlink_if1                  2167 23.459  1812/ 2824 100 (100)  READY  4

Processes: 26 total, 12 running, 14 sleeping
CPU usage: 93.90% tasks, 2.91% sched, 3.19% idle     77.08% tasks, 2.87% sched, 20.05% idle -16.82%
DMA Memory: 5120 total, 1024 used 1024 peak
Uptime: 18.242s total, 2.419s idle
2021-11-05 13:50:02 -04:00