2809 Commits

Author SHA1 Message Date
Julian Oes
6a6b8d49fc msg: re-use manual_control_input in setpoint
This way we avoid duplication between manual_control_input and
manual_control_setpoint.
2021-11-09 16:05:25 +01:00
Julian Oes
bd0c1014d9 manual_control: support arming button
The arming button required some refactoring in order to support to
toggle arm/disarm using the vehicle_command. Otherwise manual_control
would have to subscribe to the arming topic and we would spread out the
logic again, and risk race conditions.
2021-11-09 16:05:25 +01:00
Daniel Agar
2f8cb5a1c2 mavlink: initial support for MAG_CAL_REPORT stream 2021-11-07 16:03:34 -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
RomanBapst
56cf77a74c addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
RomanBapst
e36e527488 fixed wrong path
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
Roman Bapst
d58d13b2e8 APX4-1617: Fix manual climb rate in TECS (#1463)
* tecs: workaround for the fact that vel smoothing lib uses a DOWN coordinate system

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
RomanBapst
7cb99f521c moved ManualVelocitySmoothing to motion_planning lib
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
RomanBapst
924298e9c3 addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
RomanBapst
0ac3077bdc tecs: use trajectory generation library to compute height rate setpoint
- added ability to specify maximum acceleration constraint for height rate setpoint
- added support for locking altitude setpoint when in height rate control
mode and height rate input is zero

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
Silvan Fuhrer
b77487d69c Fixed-wing Position controller: add modes for auto altitude and auto descend
- bit of clean up
- add GPS failsafe mode auto_altitude, that will keep current altitude with a fixed-bank angle
for some time, then switches to auto_descend that will descend with constant sink rate
of 0.5m/s
- params controlling GPS failsafe are not FW params: NAV_GPSF_R --> FW_GPSF_R and
NAV_GPSF_LT --> FW_GPSF_LT

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-05 12:09:39 +03:00
Vatsal Asitkumar Joshi
ea1ae73526
Support for Raspberry PI RP2040 MCU (#18083) 2021-11-03 12:14:30 -04:00
Silvan Fuhrer
da4d6dc657 L1: increase the max allowed tangential velocity in the opposite direction to 2m/s
There is logic in L1 that prevents the vehicle from trying to achieve
an impossible loiter entry (e.g. due to wind). That check makes the
vehicle track the loiter center if the tangential velocity is in the wrong
direction while loitering. After the vehicle flies through the center, it can
then turn the other way around to join the loiter.
This check is though too sensitive if it purely checks for the wrong direction,
and it can end in delayed loiter entry for no reason.
This commit increases the threshold to 2m/s of tangential velocity
in the wrong direction to trigger the check.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 12:32:58 +03:00
Daniel Agar
6d0c6bb6ce
lib/world_magnetic_model: cmake remove helper target BYPRODUCTS
- otherwise ninja will try to rebuild these
2021-10-26 18:52:12 -04:00
Daniel Agar
88a979cf1d lib/world_magnetic_model: add cmake helpers for updating tables
- `world_magnetic_model_update` to fetch latest geo_magnetic_tables.hpp
 - `world_magnetic_model_tests_update` to fetch latest test_geo_lookup.cpp
2021-10-26 14:39:58 -04:00
Silvan Fuhrer
73fe300c00 WindEstimator: remove option to disable scale estimation
The situation where this would be desired is unclear, plus it's basically
the same as setting ASPD_SC_P_NOISE to a very small value.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
b38bf23d6e WindEstimator: avoid division by 0
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
a2faac148f AirspeedValidator: check_airspeed_innovation() check absolute innovations
Do no longer use tas_innovation from wind estimator and test ratio, but calculate
the innovation  based on wind estimate, TAS measurement (including currently applied scale)
and ground velocity. Use innovations directly to trigger failure.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
259b851ba7 WindEstimator: remove filter reset due to airspeed measurement rejection
As the purpose of this wind estimator is to (mainly) catch airspeed failures,
we don't value estimator stability as much as the reliability to catch
actual sensor issues, and thus do not reset the filter (as this may hide
a real issue with the sensor)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
3ad901e51d Wind Estimator: use time_literals
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer
625f556b0e AirspeedSelector: airspeed scale estimation improvements and robustification
- run airspeed scale estimation always, not in dedicated mode
- add option to apply scale automatically, with extra feasibility check
- add airspeed scale for all 3 possible airspeed instances
- clean up parameters
- add check for data stuck (non-changing airspeed data)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
bresch
78fe6e2152 VelocitySmoothing: fix issue when delta vel is the same on all axes
When the change in velocity is exactly the same on several axes, the T1
of the recumputed trajectories after time sync was set to 0 because it
was skipping both if and else if.
2021-10-22 10:54:36 +02:00
Daniel Agar
6fb1c79ef0 mixer_module: reject mixer load and reset when dynamic mixing is enabled 2021-10-21 11:27:33 -07:00
mcsauder
21163d859e Whitespace cleanup. 2021-10-19 13:29:26 -04:00
Daniel Agar
33954a904f lib/tunes: never play tunes if circuit breaker is set 2021-10-18 21:37:09 -04:00
Beat Küng
f1686b1abf px4io: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng
ab1d76ae7d params: use PWM_MAIN_* instead of PWM_FMU_* 2021-10-18 18:45:19 -04:00
Beat Küng
44bbe87165 pwm_out_sim: use PWM_FMU for sitl and HIL_ACT for hitl
We might want to change this later, but for now it allows to use the same
airframe configs for sitl/real, and independent hitl configuration.
2021-10-18 18:45:19 -04:00
Beat Küng
5f0781b6e9 output modules: add param prefix argument to MixingOutput 2021-10-18 18:45:19 -04:00
Beat Küng
916447e804 params: add script to parse timer_config.cpp for timer group info
This allows to generate pwm params in the form of:
module_name: PWM Output
actuator_output:
  output_groups:
    - generator: pwm
      param_prefix: PWM_FMU
      channel_labels: ['PWM Main', 'PWM Capture']
      standard_params:
        disarmed: { min: 800, max: 2200, default: 900 }
        min: { min: 800, max: 1400, default: 1000 }
        max: { min: 1600, max: 2200, default: 2000 }
        failsafe: { min: 800, max: 2200 }
      extra_function_groups: [ pwm_fmu ]
      pwm_timer_param:
        description:
            short: Output Protocol Configuration for ${label}
            long: |
                Select which Output Protocol to use for outputs ${label}.

                Custom PWM rates can be used by directly setting any value >0.
        type: enum
        default: 400
        values:
            -5: DShot150
            -4: DShot300
            -3: DShot600
            -2: DShot1200
            -1: OneShot
            50: PWM50
            100: PWM100
            200: PWM200
            400: PWM400
        reboot_required: true
2021-10-18 18:45:19 -04:00
Beat Küng
6f01b69f49 mixer_module: add param generation for disarmed, min, max, failsafe 2021-10-18 18:45:19 -04:00
Beat Küng
15daded6b0 refactor output_limit: split output_limit_calc_single into separate function 2021-10-18 18:45:19 -04:00
Beat Küng
c55626d2d6 refactor Tools/serial: move non-serial param generation into separate script 2021-10-18 18:45:19 -04:00
Beat Küng
a65533b469 mixer_module: add output functions for servos, landing gear, parachute, RC passthrough & gimbal 2021-10-18 18:45:19 -04:00
Beat Küng
4b37a3d017 mixer_module: generate output_functions header from yaml file 2021-10-18 18:45:19 -04:00
Beat Küng
fd76e5488e mixer_module: add output functions 2021-10-18 18:45:19 -04:00
Beat Küng
38fa65a47e control_allocator: remove direct mixer, add actuator_{motors,servos} instead 2021-10-18 18:45:19 -04:00
Beat Küng
a51c465b54 control allocation: introduce parameter SYS_CTRL_ALLOC & unify build targets 2021-10-18 18:45:19 -04:00
Beat Küng
0c5a79d84d fix mixer_module: use PRIx32 for debug printf 2021-10-18 18:45:19 -04:00
Thomas Debrunner
f08f2a340d motion_planning: In VelovitySmoothing, mark const functions const 2021-10-13 21:25:43 -04:00
Thomas Debrunner
fed234de81 flight_mode_manager: Extracted position trajectory motion planning into a library
Extract the functionality to plan smooth position motion trajectories into a
motion planning library, such that it can be used in other parts of the code as well.
2021-10-13 21:25:43 -04:00
Matthias Grob
8b37db7825 Functions: fix corner case x_low == x_high == value resulting in NAN
and added unit test to cover it
2021-10-13 17:24:16 -04:00
Jukka Laitinen
351f679c2f parameters: Use px4::atomic_bool instead of px4::atomic<bool>
This enables us to define the actual atomic bool type in px4_platform

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-10-13 15:01:26 -04:00
RomanBapst
ae5d3103f4 fw l1 controller: added a flag to indicate if navigation has updated
- can be used to check if l1 controller ran during a cycle

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-11 16:41:42 +02:00
Daniel Agar
089f96f800 lib/drivers/{accelerometer,gyroscope} skip obselete Vector3f construction
- FIFO clip count only check if value is INT16_MIN/MAX rather than abs() call
2021-10-08 17:33:27 -04:00
bresch
984a698760 matrix: update to include min/max of slices 2021-10-08 09:35:40 +02:00
Beat Küng
393f59ae71 param jsonout: handle @boolean flag
This got lost when switching from xml to json metadata
2021-10-07 09:20:50 -04:00
Silvan Fuhrer
4e3fa7cf35 VTOL: rework forward actuation assist
-allow positive pitch offsets in hover
-add param for min pitch during LAND

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-06 11:27:19 -04:00
bresch
1b58202b0d AlphaFilter: add function to set param from cutoff frequency 2021-10-06 16:26:03 +02:00