Commit Graph

27982 Commits

Author SHA1 Message Date
Daniel Agar c0a56ce268 airspeed_selector: fix groundspeed typos 2023-07-17 20:37:46 -04:00
bresch f5fd369ce8 [AUTO COMMIT] update change indication 2023-07-17 13:43:18 +02:00
bresch 1128ada90a ekf2: use correct AlphaFilter for 3D rotations 2023-07-17 13:43:18 +02:00
bresch 15bb8c0f2e AlphaFilter: add unit tests for Rot3 filtering 2023-07-17 13:43:18 +02:00
bresch c6aa82441f AlphaFilter: add quaternion specialization
Filtering 3D rotations require special care as they live on a curved space.
2023-07-17 13:43:18 +02:00
Silvan Fuhrer 88c5565a29 Commander: remove COM_ARM_ARSP_EN
Since we changed the threshold for allowing arming from TRIM/2 to AIRSPEED_MAX
is is very unlikely that one needs to disable this check.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-17 10:35:02 +02:00
Silvan Fuhrer decf1ac0a8 Commander/Nav params: clean up descriptions
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-17 10:35:02 +02:00
Silvan Fuhrer 351f2a8287 VTOL: remove VT_B_DEC_FF
Experience from tuning different VTOL backtransitions showed only having a
I controller is beneficial over a combined FF/I breaking controller.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-17 10:35:02 +02:00
Silvan Fuhrer 8fe5ce4f65 VTOL: param description clean up
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-17 10:35:02 +02:00
Matthias Grob 83b832fdce ManualControl: fix case where mode switches unintentionally in air
Case: A vehicle is already operating but has no stick input or another
source than RC. When RC stick input is switched to either because it gets
first time available or as a fallback to joystick then the mode was
immediately changed to the switch position. This can lead to loss of
control e.g. when the vehicle is flying far away and the
mode switch of the RC is in some fully manual piloted mode.

I added tests to cover the cases where RC mode initialization is expected
and also unexpceted because the vehicle is already armed.
2023-07-13 12:00:35 +02:00
Matthias Grob 2235c40e28 ManualControl: add functional test for switch behavior
Using the established interface processInput() function.
2023-07-13 12:00:35 +02:00
Matthias Grob 877f37d79e ManualControlSelector: add parentheses in condition for clarity 2023-07-13 12:00:35 +02:00
Matthias Grob b19b0d0163 ManualControl: separate switches logic function + reset fix
Fix the previous switches initialized flag getting reset when no RC was
present or in use. This was found during functional testing.
2023-07-13 12:00:35 +02:00
Matthias Grob 3b2b60adde ManualControl: put input processing in separate testable function 2023-07-13 12:00:35 +02:00
Matthias Grob 8dc73c4621 ManualControl: correct manual control input subscription name 2023-07-13 12:00:35 +02:00
Matthias Grob 258fc786dc ManualControl: put parameter update into separate function 2023-07-13 12:00:35 +02:00
Matthias Grob 17535c288c ManualControl: correct CMake module definition
modules__ instead of module__ prefix
The module depends on the hysteresis library and probably because
it compiles with the still prevalent global includes the dependency
is not declared.
2023-07-13 12:00:35 +02:00
Matthias Grob 632596c1ea FlightTask: correct header comments 2023-07-13 12:00:35 +02:00
Matthias Grob 618724b409 Functional gtests: remove unnecessary subscription updates
A new subscription is updated on instanciation and no additional
update needs to be called for processing the first sample.
2023-07-13 12:00:35 +02:00
Sergei Grichine f000238987 SensorGps.msg: switch to double precision for lat/lon/alt
To match https://github.com/PX4/PX4-GPSDrivers/pull/132 - adding high precision RTK lat/lon/alt components
2023-07-13 07:50:09 +02:00
henrykotze f82785a322 CAN Filters for STM32H7 & bus-off handling 2023-07-12 11:56:37 -04:00
Loic Fernau f8c9be087b drivers: rework NXP UWB driver (#21124)
* UWB driver rework that uses 2 UWB MKBoards - 1 as Controller (Initiator), one as Controllee (Anchor)

Co-authored-by: NXPBrianna <108274268+NXPBrianna@users.noreply.github.com>
2023-07-12 11:44:23 -04:00
bresch 9ebfed010f mag_cal: increase uncertainty of calibration parameters
in air bias estimation is usually really accurate and should be weighted
more heavily compared to the calibration parameters that are often
more approximate given the worse magnetic environment near the ground.
2023-07-11 11:33:53 -04:00
bresch 9e2e888f5e ekf2-bias_cal: reduce required stability period
For the mag, 30s of bias learning is a lot, given that it is only active
during turns and that it usually converges in < 5 seconds
2023-07-11 11:33:53 -04:00
bresch 2f52926972 mag_cal: fix mag bias estimate to mag cal
- since last_us is set to 0 every time the bias is not observable, the
  total time was also reset -> needed 30 consecutive seconds in mag 3D
  to be declared "stable"
- after landing, the mag_aligned_in_flight flag is reset. Using this for
  bias validity makes it invalid before we have a chance to save it to
  the calibration.
2023-07-11 11:33:53 -04:00
alexklimaj 69aa8689c0 Revert "rover_pos_control: thrust normalization for joystick input (#20885)"
This reverts commit 22f7d913bd.
2023-07-11 08:25:50 -07:00
bresch f5edff2647 ekf2 - preflt checks: scale flow innovation checks
Opt flow raw innovations can be really large on ground due to the small
distance to the ground (vel = flow / dist). To make the pre-flight check
more meaningful, scale it with the current distance.
2023-07-11 08:18:32 -07:00
bresch 672b29d555 ekf2: report dist bottom also when using flow for terrain
Terrain height can be estimated using a range finder and/or optical flow
2023-07-11 08:18:32 -07:00
alexklimaj 03528a6200 Add EKF2_OF_QMIN_GND to handle 0 optical flow quality when on ground 2023-07-11 08:18:06 -07:00
alexklimaj bca0be47bc Apply code review changes from @dagar 2023-07-11 08:18:06 -07:00
Eric Katzfey 9511248514 Removed the huge HAGL fuse timeout increase 2023-07-11 08:18:06 -07:00
Eric Katzfey f5d9ac4526 Cleaned up some comments and debug code 2023-07-11 08:18:06 -07:00
mjturi-mai 56c794108d actual fixes for velocity estimate errors and bad rng fusion 2023-07-11 08:18:06 -07:00
Matthias Grob 2dcb525cd9 RCUpdateTest: RC switch correct corner case test value
Co-authored-by: Junwoo Hwang <junwoo091400@gmail.com>
2023-07-11 15:58:48 +02:00
Matthias Grob 42fa41e601 rc_update: fix on-off-switch with negative threshold values 2023-07-11 15:58:48 +02:00
Matthias Grob 1fa5136e30 RCUpdateTest: add unit test for return switch 2023-07-11 15:58:48 +02:00
Matthias Grob 392d445783 RCUpdateTest: fix unit test parameters + restoring state after test
Channel values stay over one unit test but some tests assumed they are
reset each time. Reset the channel after these mode button tests.

Parameters survive between unit tests presumably as long as
the bianry runs. Reset them if a test requires that.
2023-07-11 15:58:48 +02:00
Matthias Grob e127ada07b rc_update: extend ModuleParams::updateParams() for local parameter updates 2023-07-11 15:58:48 +02:00
Matthias Grob 87c697a0d6 rc_update: switch back to protected scope and use fixture for testing 2023-07-11 15:58:48 +02:00
Silvan Fuhrer 81764c43a1 EKF2: use timestamp from argument of PublishEvPosBias() (#21822)
* EKF2: use timestamp from argument of PublishEvPosBias()

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* Update src/modules/ekf2/EKF2.cpp

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2023-07-11 11:07:39 +02:00
Matthias Grob 02ab5e0704 drv_pwm_output: remove unused PWM_ defines 2023-07-10 18:58:37 +02:00
Matthias Grob e776aca9ef UUV: stop motors when commanding zero speed 2023-07-10 18:58:37 +02:00
Matthias Grob 6b7aed3d44 Boats: stop motors when commanding zero speed 2023-07-10 18:58:37 +02:00
Matthias Grob 95a35c972d Rovers: stop motors when commanding zero speed 2023-07-10 18:58:37 +02:00
Matthias Grob 0be6069b83 TiltrotorVTOL: allow stopping front tilted motors in fast forward flight 2023-07-10 18:58:37 +02:00
Matthias Grob 66b451e61f TailsitterVTOL: allow explicitly stop forward motor with zero thrust 2023-07-10 18:58:37 +02:00
Matthias Grob 5568afbb12 StandardVTOL: explicitly stop forward motor with zero thrust 2023-07-10 18:58:37 +02:00
Matthias Grob 6b7b34a71a FixedWing: explicitly stop forward motor with zero thrust
This allows PWM and all other output methods to configure
stopped, idling and full thrust points and use them consistently.
The fact that a fixed wing motor can be stopped when zero thrust
is demanded is explicit and could in principle even be disabled.
The mechanism is the same as for a standard VTOL stopping the
multicopter motors in the fixed wing flight phase.
2023-07-10 18:58:37 +02:00
Matthias Grob 2a077181d9 ActuatorEffectiveness: add function to delectively stop motors with zero thrust 2023-07-10 18:58:37 +02:00
Matthias Grob a8bf47e606 Set default minimum and maximum PWM for motors
This allows to consistently define:
Motor stopped - disarmed PWM
Motor idling - minimum PWM
Motor at full thrust - maximum PWM

Any allocation can then distinctly decide if
a motor should be running or not depending
on the context and also explicitly command that.
2023-07-10 18:58:37 +02:00