Commit Graph

1937 Commits

Author SHA1 Message Date
Julien Lecoeur 8f910f8435 ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters (#13249)
* Conversions lib: add quaternion getter

* vehicle_status: add flag is_vtol_tailsitter

* ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters
2019-10-28 09:27:53 +01:00
Daniel Agar 967446af4c clang-tidy: enable readability-simplify-boolean-expr and fix 2019-10-27 19:19:07 -04:00
Beat Küng b5ba1665f6 commander: add COM_MOT_TEST_EN parameter to enable/disable motor testing 2019-10-24 09:27:29 +02:00
Beat Küng 0d91d4e702 commander: do not beep on successful commands
DO_MOTOR_TEST is sent continuously, which led to constant beeping
2019-10-24 09:27:29 +02:00
Beat Küng f7b04d5cbc commander: answer to VEHICLE_CMD_DO_ORBIT 2019-10-24 09:27:29 +02:00
Beat Küng 285ae608a5 commander: add support for DO_MOTOR_TEST
- add an optional timeout to test_motor
- enforce a timeout when receiving DO_MOTOR_TEST
- limitation: DO_MOTOR_TEST can only control the MAIN outputs
2019-10-24 09:27:29 +02:00
Mathieu Bresciani 549fb0d5de ekf2_main - Add optical flow innovation pre-flight check (#13036)
* ekf2: Add FirstOrderLpf and InnovationLpf classes for innovation lowpass filtering

* ekf2: use InnovLpf filter class in preflight checks

* ekf2: move selection of yaw test limit for pre-flight check in function

* ekf2: Move pre-flight checks into separate function

* ekf2: use static constexpr insetead of inline for sq (square) function

* ekf2: Split pre-flight checks in separate functions
Also use the same check for all the innovations:
innov_lpf < test and innov < 2xtest

* ekf2: Add optical flow pre-flight check

* ekf2: Combine FirstOrderLpf and InnovationLpf in single class

* ekf2: check vel_pos_innov when ev_pos is active as well

* ekf2: transform InnovationLpf into a header only library and pass the
spike limit during the update call to avoid storing it here

* ekf2: Static and const cleanup
- set spike_lim constants as static constexpr, set innovation
- set checker helper functions as static
- rename the mix of heading and yaw as heading to avoid confusion

* ekf2: use ternary operator in selectHeadingTestLimit instead of if-else

* ekf2: store intermediate redults in const bool flags. Those will be used for logging

* ekf2: set variable const whenever possible

* ekf2: create PreFlightChecker class that handle all the innovation
pre-flight checks.
Add simple unit testing
Use bitmask instead of general flag to have more granularity

* PreFlightChecker: use setter for the innovations to check instead of sending booleans in the update function
This makes it more scalable as more checks will be added

* ekf: Use booleans instead of bitmask for ekf preflt checks
Rename "down" to "vert"
2019-10-22 16:22:42 +02:00
Nick Steele 070d75496d Handle MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN 'Do nothing for autopilot' 2019-10-18 15:57:50 -04:00
Julian Oes de90543d6f FlightTasks: add Descend task to land without GPS
This adds a flight task to catch the case where we want to do an
emergency descent without GPS but only a baro.

Previously, this would lead to the navigator land class being called
without position estimates which then made the flight tasks fail and
react with a flight task failsafe. This however meant that landed was
never detected and a couple of confusing error messages.

This applies if NAV_RCL_ACT is set to 3 "land".
2019-10-18 16:18:19 +02:00
RomanBapst 6bfb50df8a run arm authorization as last pre-arm check, as it used to be implemented
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-15 15:44:24 +01:00
Matthias Grob e843090383 Replace a lot of memset with {} initializers 2019-10-15 10:01:03 -04:00
Matthias Grob 185e2811dc gyro_calibration: use constexpr instead of const 2019-10-15 10:01:03 -04:00
Daniel Agar 97efbde6f4 WIP: commander re-evaluate RC mode switch when local position becomes valid 2019-10-14 14:16:24 +02:00
Dusan Zivkovic ab2e235333 Commander: bugfix: get all available messages on the subsystem_info topic 2019-10-10 13:12:31 +02:00
Matthias Grob ca711fecc7 Commander: improve message for RC override event 2019-10-09 15:34:46 +02:00
Matthias Grob c1faea8d32 Commander: add const qualifiers for clarity 2019-10-09 08:03:07 +02:00
Matthias Grob 63f2c009c7 PreflightCheck: refactor failureDetectorCheck return value 2019-10-09 08:03:07 +02:00
Matthias Grob 8e0ee88e0a PreflightCheck: add const qualifiers to parameters
to help readability
2019-10-09 08:03:07 +02:00
Matthias Grob c570dc9315 PreflightCheck: remove goto from imu consistency check 2019-10-09 08:03:07 +02:00
Daniel Agar a5895e5a99 Revert "commander: update parameter strings to class enum"
This reverts commit c322f1d156.
2019-10-03 11:28:44 -04:00
Daniel Agar c322f1d156 commander: update parameter strings to class enum 2019-10-02 19:43:32 -04:00
Daniel Agar c8e59c4e39 parameter_update use uORB::Subscription consistently 2019-09-29 10:49:03 -04:00
Daniel Agar 105bbef3bf commander: rc_calibration move to uORB::Subscription 2019-09-28 16:43:53 -04:00
bresch 6139812293 FailureDetector - use standard topic subscription for attitude topic and
pass vehicle_status from commander instead of subscribing to it.
2019-09-24 14:17:58 +02:00
bresch 000c1e364c FailureDetector - Ignore attitude check for MC in acro and rattude, and FW in manual, acro and rattitude modes 2019-09-24 14:17:58 +02:00
Matthias Grob 412b44ff6e Commander: allow RC to override during RTL 2019-09-23 12:42:33 +02:00
Matthias Grob 4f44fde080 Commander: remove not disarming by RC message
Refactoring the condition to be more clear.
2019-09-23 12:42:33 +02:00
bazooka joe fb3a91cc4f added circuit_breaker_enabled_by_val()
added and using circuit_breaker_enabled_by_val() where possible instead of circuit_breaker_enabled() which search for cbrk parameters by name, which is extensive process.
2019-09-22 13:55:40 -04:00
Julian Kent 2d4ecab3b0 Remove unsafe access to .data() and _data in Matrix 2019-09-18 22:01:36 -04:00
Julien Lecoeur 47355333ad Clarify comment 2019-09-02 10:47:40 -04:00
Julien Lecoeur 9c50f5ea08 Add parameter COM_PREARM_MODE
Condition to enter the prearmed state, an intermediate state between disarmed and armed
 * in which non-throttling actuators are active.
 *
 * @value 0 Disabled
 * @value 1 Safety button
 * @value 2 Always
2019-09-02 10:47:40 -04:00
Daniel Agar 891aae0377 commander increase cpu overload threshold
* the large 20% margin is no longer appropriate now that nearly all work in the system is
scheduled (moved out of ISRs) and represented in the load percentage
 * closes https://github.com/PX4/Firmware/issues/12753
2019-09-01 14:55:05 -04:00
Daniel Agar 78ef8aab2d STACK_MAIN increase default 1024 -> 2048 2019-08-30 19:11:51 -07:00
Julien Lecoeur 7fa885c7b3 Document the behaviour of TERMINATE and LOCKDOWN in comments 2019-08-21 07:56:20 -07:00
Julien Lecoeur 85c2e7d65d Offboard failsafe actions: cleanup and move to dedicated functions 2019-08-21 07:56:20 -07:00
Julien Lecoeur 84eeacfb38 Offboard failsafe actions: add DISABLED, LOCKDOWN and TERMINATE options 2019-08-21 07:56:20 -07:00
Julien Lecoeur 4c9288d993 Commander: cleanup COM_POSCTL_NAVL parameter
- move to px4::params
- use enum
2019-08-21 07:56:20 -07:00
Beat Küng a7eed520b4 commander: refactor module usage output 2019-08-19 10:54:56 +02:00
Beat Küng d64d3170c0 commander unit tests: enable preflight checks
- the last check expects pre_arm to run so we need to enable the
  preflight checks. This is closer to the real system.
- as a result we need to enable HIL for other tests so that the sensors
  are not checked.
2019-08-19 10:54:56 +02:00
Beat Küng 878ed8136c commander: add 'commander arm -f' command to force arming
This allows to bypass preflight and prearm checks.
During development there are regular cases where I just want to arm the
board/vehicle no matter what, and the preflight checks are guaranteed to
fail (e.g. sensors uncalibrated, inconsistent, powered via USB, etc.).
Allowing an easy and quick way to arm (assuming you know what you are
doing) helps to speed up development considerably and is less frustrating.
2019-08-19 10:54:56 +02:00
Beat Küng b8dba34fd0 commander arming_state_transition: do not call prearm_check if !fRunPreArmChecks
Reason: if you don't want preflight checks, you don't want prearm checks
either (these are the circuit breakers, like usb connected check).

The other changes are cleanup and rework of operations.

In most cases, arming_state_transition is called with fRunPreArmChecks set
to true, so no change in behavior.

The cases with fRunPreArmChecks=false are:
- unit tests
- in_arming_grace_period=true (quick arming after disarm)
- VEHICLE_CMD_PREFLIGHT_CALIBRATION (does not transition to armed)
2019-08-19 10:54:56 +02:00
Mathieu Bresciani dab66e92d3 Fix typo 2019-08-15 14:31:23 +02:00
Dennis Mannhart bf25c462b2 Orbit failsafe: switch internal_state to Posctrl such that Manual-Positionctrl is activated after failsafe recovery. This is needed because Orbit can only be invoked via vehicle_command msg. 2019-08-15 14:31:23 +02:00
Julian Oes a4fb18a6c4 commander: fix arming auth param translation
The int32 param COM_ARM_AUTH is mapped to a packed struct. However, this
struct was not actually packed (anymore) and therefore the values were
applied incorrectly.

I fixed this by applying the packed attribute. By using a union with a
int32_t I could rid of the warning about address-of-packed-member.
2019-08-14 13:29:07 -04:00
Jimmy Johnson 9e3493bd6e Update commander_params.c
Addressing parameter description syntax
2019-08-14 14:17:33 +02:00
Jimmy Johnson 3ab5932adf updating pre-takeoff and landding values to defaults 2019-08-14 14:17:33 +02:00
Jimmy Johnson 963467b4df splitting preflight and land disarm times into 2 parameters 2019-08-14 14:17:33 +02:00
Claudio Micheli 2eb9fb9ed6 Commander: move esc_status as local variable.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli 09d79b221f Simplified esc_status healthiness logic.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli 75c336c00c uavcan_main: replaced printf messages with PX4_INFO
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00