Commit Graph

16111 Commits

Author SHA1 Message Date
bresch e9a2b3f260 geofence: remove unused function parameters 2022-04-19 15:29:25 +02:00
bresch 3f3a4ac5c1 navigator: home_positionvalid -> global_home_position_valid
This is to make clear that the relevant part of the home position
message for navigator is the global one. Local home position isn't
required as everything is done in global coordinates.
The specific home_alt_valid is used when lat/lon are not used
2022-04-19 15:29:25 +02:00
bresch d2f2ba59a4 commander: refactor home position setter
- always try to set local or global home position when possible
- set global home with GNSS position if global pos from EKF isn't
  available
- reset home when significantly moved from home before takeoff (checking
  lpos or gpos or GNSS)
- reset home on takeoff transition
- reset home on mavlink arm command
- remove "home required accuracy" parameters, rely on validity flags
2022-04-19 15:29:25 +02:00
RomanBapst a7683eea07 mission_block: fix vehicle not exiting loiter after reaching exit heading
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-04-19 13:32:18 +02:00
Thomas Stastny d5a6174e7f mission block: fix incorrectly calculated ccw loiter exit (#19487)
* mission block: fix incorrectly calculated ccw loiter exit

* mission block: update comment on orbit exit location
2022-04-19 13:30:11 +02:00
bazooka joe 5d95cc001f small cleanup for FlightTask::_evaluateDistanceToGround if-else 2022-04-18 20:47:41 -04:00
Daniel Agar 3cdeeb8d64 px4iofirmware: convert most files to c++ 2022-04-17 20:44:30 -04:00
Beat Küng 9a9aad98a1 mavlink: add COMPONENT_METADATA message
And still support the previous message COMPONENT_INFORMATION for now.
2022-04-14 09:55:06 -04:00
Igor Misic cdfa65d792 commander/safety: set early safety_button_available 2022-04-14 08:03:37 +02:00
Thomas Debrunner f6bdc42977 param-reset: Add option to reset all configurable params, but not the ones that store vehicle information 2022-04-14 07:57:48 +02:00
Daniel Agar 3f13c70cae px4io cleanup LED and heater handling
- most px4_io-v2 boards have a blue LED that breathes for status
 - the pixhawk 2.1 (hex) re-used this blue LED for as an IMU heater (active low), but kept the same board id (so we have to detect at runtime)
 - the new cubepilot boards (yellow, orange) inverted the polarity of this heater pin
 - untangle the mess slightly so that things we know statically (eg cubepilot cubeorange LEDs and heater polarity) are handled at build time.
2022-04-13 18:43:59 -04:00
PX4 BuildBot 93268a285d Update submodule mavlink to latest Wed Apr 13 12:39:05 UTC 2022
- mavlink in PX4/Firmware (16fd85d9b9133f21a79a5c1bccbf4756f4b3c781): https://github.com/mavlink/mavlink/commit/56a5110d38b77c8477b0a1d6ee909607a588f98d
    - mavlink current upstream: https://github.com/mavlink/mavlink/commit/3b52eac09c2e37325e4bc49cd2667ea37bf1d7d2
    - Changes: https://github.com/mavlink/mavlink/compare/56a5110d38b77c8477b0a1d6ee909607a588f98d...3b52eac09c2e37325e4bc49cd2667ea37bf1d7d2

    3b52eac0 2022-04-13 Beat Küng - add COMPONENT_METADATA, deprecate COMPONENT_INFORMATION (#1823)
2022-04-13 14:09:03 -04:00
Daniel Agar b4158c1b48 sensors/vehicle_imu: Integrator use 1 microsecond for minimum DT
- this is a more realistic minimum for the system
2022-04-13 10:36:45 -04:00
Daniel Agar d2f1349d1a sensors/vehicle_imu: replace coning metric with actual integrator coning correction (averaged)
- this saves a relatively expensive higih rate cross product and gives
better visibility into what's actually happening internally
2022-04-13 10:36:45 -04:00
bresch 37cafe7dcd ekf rng kin: reduce minimum rng variance 2022-04-13 11:41:48 +02:00
bresch 4994649500 ekf rng kin: increase default gate size
The user needs to tune the range finder noise parameters properly and we
shouldn't need such a small gate
2022-04-13 11:41:48 +02:00
bresch 1fbe04986f ekf rng finder consistency: simplify class member names 2022-04-13 11:41:48 +02:00
bresch 4c03f0bc50 ekf: make range finder kin consistency gate tunable by parameter 2022-04-13 11:41:48 +02:00
bresch 079a5e92ba ekf: run rng consistency check only when not horizontally moving
The check assumes a non-moving terrain height
2022-04-13 11:41:48 +02:00
bresch d903613c9c ekf: add logging for rng kinematic consistency check 2022-04-13 11:41:48 +02:00
bresch 8693ad15a7 ekf: add logging of range finder consistency check 2022-04-13 11:41:48 +02:00
bresch baf9cc9597 ekf: use uint64_t for time variables 2022-04-13 11:41:48 +02:00
bresch 9fc331b7ea ekf: requires kinematically consistent range finder data to continue terrain aiding 2022-04-13 11:41:48 +02:00
bresch 78211f9dbb ekf: improve rng consistency check
To pass from invalid to valid:
- time hysteresis
- some vertical velocity
- test ratio < 1
- low-passed signed test ratio < 1

To pass from valid to invalid:
- low-passed signed test ratio >= 1
2022-04-13 11:41:48 +02:00
bresch b1ea2e4e15 ekf: use same gate for innov and innov sequence monitoring 2022-04-13 11:41:48 +02:00
bresch f96287b80a ekf: access member variable without getter 2022-04-13 11:41:48 +02:00
bresch 904bf8ef9f ekf: add range finder kinematic consistency check
At each new valid range measurement, the time derivative of the distance
to the ground is computed and compared with the estimated velocity.
The average of a normalized innovation squared statistic check is used
to detect a bias in the derivative of distance measurement,
indicating that the distance measurements are kinematically inconsistent
with the filter.
2022-04-13 11:41:48 +02:00
bresch 064518f57a ekf: extract range finder noise computation 2022-04-13 11:41:48 +02:00
Matthias Grob 97b2947416 FlightTaskAuto: refactor _commanded_speed_ts -> _time_last_cruise_speed_override 2022-04-13 12:23:27 +03:00
Matthias Grob 68cf686892 FlightTask: rename and move setCruisingSpeed() -> overrideCruiseSpeed() 2022-04-13 12:23:27 +03:00
Matthias Grob f892a624b7 FlightModeManager/FixedwingPositionControl: robustify vehicle command parameter casting 2022-04-13 12:23:27 +03:00
RomanBapst 3ed929c7b6 addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-04-13 12:23:27 +03:00
RomanBapst d41de33a85 FlightModeManager: handle MAV_CMD_DO_CHANGE_SPEED
- support setting the cruise speed of the auto flight task via command

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-04-13 12:23:27 +03:00
RomanBapst ca657f36ef FixedWingPositionControl: handle VEHICLE_CMD_DO_CHANGE_SPEED
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-04-13 12:23:27 +03:00
RomanBapst 36e32ecd7b navigator: stop handling speed changes via reposition triplet
- the mc and fw controllers are handling the speed changes directly

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-04-13 12:23:27 +03:00
Matthias Grob 10f927ae2b MulticopterPositionControl: remove unused return value parameters_update() 2022-04-12 10:13:11 -04:00
Daniel Agar 8166a500ac Update world_magnetic_model to latest Mon Apr 11 11:14:11 UTC 2022 (#19475) 2022-04-12 10:11:51 -04:00
Daniel Agar bb2ea574aa ekf2: properly reset IMU biases on calibration change (non-multi-EKF)
- this was working in the multi-EKF case using vehicle_imu, but missing
in sensor_combined
2022-04-11 12:23:55 -04:00
Daniel Agar 04f37222f8 ekf2: fix IMU missed perf count when not using multi-EKF 2022-04-10 11:07:33 -04:00
PX4 BuildBot f2c5d70d3a Update submodule mavlink to latest Sun Apr 10 12:39:00 UTC 2022
- mavlink in PX4/Firmware (a1530591764f0c694560e4bb6ae41c15d3e35c9b): https://github.com/mavlink/mavlink/commit/0133e5db7fd640dcf250f3ba7817d6f0f7bb7589
    - mavlink current upstream: https://github.com/mavlink/mavlink/commit/56a5110d38b77c8477b0a1d6ee909607a588f98d
    - Changes: https://github.com/mavlink/mavlink/compare/0133e5db7fd640dcf250f3ba7817d6f0f7bb7589...56a5110d38b77c8477b0a1d6ee909607a588f98d

    56a5110d 2022-04-09 Tom Pittenger - Add radius to DO_REPOSITION (#1825)
3b5959bd 2022-04-07 Thomas Debrunner - Option to not reset non-configurable params in preflight storage (#1826)
2022-04-10 10:21:14 -04:00
Silvan Fuhrer c7023e5879 Increase NAV_LOITER_RAD and RTL_LOITER_RAD to 80m each
For many VTOLs/fixed-wing drones a 50m loiter radius is too tight, and
going to 80m is a better and safer default.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-04-09 14:31:17 -04:00
Nicolas MARTIN eb1bb4335b commander: fix enable_failsafe reason (#19391)
- In this case, no action is configured for datalink lost. Action is configured for RC lost.
 - In case of no data link and no rc failsafe is enabled but reporting a "no_datalink" reason but "no_rc_and_no_datalink" seems more explicit.
2022-04-09 14:30:49 -04:00
Daniel Agar 091fca701e px4io: input_rc only publish new successful decodes
- previously an invalid decode would continue to be transferred to the FMU (at 50 Hz) and published to the rest of the system as successfully decoded new RC data
 - by only publishing new successful decodes we can more effectively discard invalid data in downstream consumers
2022-04-09 14:28:16 -04:00
Matthias Grob fe26ee244d modeCheck: allow arming in land mode for MAVSDK compatibility
ideally we can remove it again when the workflow is changed to
first changing mode then arming.
2022-04-08 09:56:47 +02:00
Daniel Agar 77a37c26bf rc_update: further tighten timing requirements for valid data
- any real RC data input will be much faster than 3 Hz, so this is an
easy way to minimize bogus decoded data from propagating
2022-04-07 14:42:05 -04:00
Daniel Agar 98623f69a3 update mavlink submodule to latest
- update MAV_TYPE VTOL usage for current mavlink
2022-04-07 20:35:41 +02:00
Julian Oes a5bd65b923 mavlink: set correct param capability
PX4 supports int32 parameter types by interpreting the 32 bits in
the float field as an int32 field. To signal this behaviour, it should
set the bit which is described as PARAM_ENCODE_BYTEWISE.

PX4 had always handled parameters this way but never actually sent the
capability (which back then was called PARAM_UNION), however, it should
have. This came up recently in the MAVLink devcall when these flags were
discussed. The takeaway was to remove the flags to make it clearer and
to make sure the projects (like PX4) send them out correctly.
2022-04-07 20:35:41 +02:00
Matthias Grob 92adc71424 ArmStateMachine: port over unit tests to functional gtests 2022-04-06 10:02:14 +02:00
Matthias Grob f968a5947d ArmStateMachine: port arming_state_names into the class 2022-04-06 10:02:14 +02:00
Matthias Grob 074080c816 Commander: separate out arm state machine to class
Pure refactoring and just the first step to avoid conflicts on the way.
2022-04-06 10:02:14 +02:00