Commit Graph

1538 Commits

Author SHA1 Message Date
Paul Riseborough ddfe077f7c commander: strengthen pre-flight fail checking
The commander checks use instantaneous values which are vulnerable to false negatives  or positives with noisy data or transient faults.

This patch checks the estimators published pre flight check status which is based on persistent checks using filtered data.
2017-12-04 09:09:54 +00:00
Lorenz Meier 1b7d3883a4 Commander: Obey override / manual reversion mode from external override device
This change will force commander into manual reversion mode when an external override device (like PX4IO) overrides the system externally. This is not a functional change on the outputs, as they were in override mode even without this patch. However, this change ensures that the system state is consistent with the output state and also ensures that the pilot and operator has better situational awareness when he / she triggers the manual reversion without realizing it.
2017-12-02 11:39:52 +00:00
Lorenz Meier 4abc578932 Commander: State machine helper documentation
Future contributors need to know about the time constraints that the execution of this function needs to satisfy.
2017-12-02 11:39:52 +00:00
Nicolas de Palezieux a6ae1fbcaa vehicle command ROI: do not erroneously report command unsupported; handle VEHICLE_CMD_DO_SET_ROI and VEHICLE_CMD_NAV_ROI identically (#8377) 2017-11-27 15:43:39 -05:00
Robbie Sharma ab51a41793 Removed [cal] references from calibration_log_critical() routines. 2017-11-24 08:12:37 +01:00
Beat Küng 9c8dc3941d commander: fix 'commander arm' not working in HIL mode
This got introduced with 61b0a81bf9. Due to the removed startup_in_hil flag,
this check does not work anymore, so remove it completely.
2017-10-30 20:53:58 +01:00
Daniel Agar 8b7de092a2 sensors delete unused CAL_BOARD_ID 2017-10-29 16:24:31 +01:00
Beat Küng a2fd9ef2d0 PreflightCheck: use correct type for params (int -> int32_t) 2017-10-27 10:43:15 +02:00
Beat Küng dbb0414e01 commander: remove unused SYS_AUTOSTART param 2017-10-27 10:43:15 +02:00
Beat Küng 8cbd772489 commander: fix wrong parameter types (these are defined as float, not int) 2017-10-27 10:43:15 +02:00
Beat Küng d74f792784 commander: fix type passed to param_get() 2017-10-27 10:43:15 +02:00
Beat Küng 530fdb0b61 arm_auth: make type passed to param_get() explicit 2017-10-27 10:43:15 +02:00
Beat Küng 861f5a3d11 mag_calibration: fix type passed to param_get() 2017-10-27 10:43:15 +02:00
Beat Küng 85e82dca0d commander: add COM_FLIGHT_UUID param, increased upon disarm 2017-10-17 09:56:01 +02:00
Beat Küng fa8453443f fix commander: remove arming_state_changed, check for was_armed != armed.armed instead
arming_state_changed was not set in all places where an arming transition
occurred, for example when calling arm_disarm() from auto-disarm.

We did not notice because the state is published with at least 5 Hz already.
2017-10-17 09:56:01 +02:00
Sugnan Prabhu 81809be7cd Add include guard in headers files (#8108)
Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.com>
2017-10-11 09:47:52 -04:00
Paul Riseborough 2a4336b6ef commander: EKF2 GPS requirement 20 sec after 3D lock 2017-10-06 16:22:53 -07:00
Daniel Agar 2495f8942b preflightcheck EKF2 GPS requirement after 20s 2017-10-06 16:22:53 -07:00
Daniel Agar 9a9923c517 commander simplify sensors PreflightCheck 2017-10-06 16:22:53 -07:00
Daniel Agar 263b7ea009 commander battery failsafe only error if TRANSITION_DENIED 2017-10-06 20:11:59 +02:00
Daniel Agar 80dd87536e navigator fix vehicle_command_ack (don't copy external) 2017-10-06 20:11:19 +02:00
Paul Riseborough 0def4ace5f commander: check magnetometers for inconsistency preflight 2017-10-05 09:30:26 -07:00
Beat Küng 2dd34d639d commander: ignore internal commands during calibration
if vmount was enabled in mavlink mode, it was continuously sending mavlink
commmands, which lead to 'command denied during calibration: 205' messages
during calibration.
2017-10-03 07:50:27 +02:00
Daniel Agar 3c18be387c ROI - move handling to navigator (#7939) 2017-09-26 12:25:02 -04:00
James Goppert 13e64d00a8 commander handle shutdown command (#8000) 2017-09-23 10:35:36 -04:00
Henry Zhang 4778c79201 commander: removed CONFIG_ARCH_BOARD_xxx usage 2017-09-20 18:40:55 -10:00
Julian Oes ee6a79279f commander: require local position for home
This fixes (or at least works around) a race condition where the
`status_flags.condition_local_position_valid` is still `false` but the
`status_flags.condition_global_position_valid` is already `true`.

The way to reproduce it is t:
1. Poll home position to check if home is initialized
2. Send arm and takeoff command as soon as home is initialized

Then arming will succeed but takeoff will fail because there is a check
for `status_flags.condition_local_position_valid` in
`main_state_transition()` to enter TAKEOFF.
2017-09-13 10:06:40 +02:00
David Sidrane 34cd7563fb commander:Removed PX4FMUv1 LED support 2017-09-10 13:37:23 -04:00
Daniel Agar 7a42424411 Navigator resurrect FW GPS failure navigation (#7762) 2017-09-08 12:18:59 -04:00
Daniel Agar e15afcca7a vehicle_command commands are uint16, not uint32 2017-09-08 09:06:30 +02:00
Daniel Agar 9b5fe8c476 ignore -Wsign-compare per module 2017-09-07 10:27:36 +02:00
Daniel Agar 0c38f89b23 commander params wording 2017-09-05 12:57:25 -04:00
Paul Riseborough c3b1ec8b24 commander: Changes resulting from code review
Change units of parameters from uSec to sec.
Change recommended FW value for COM_POS_FS_GAIN from 2 to 0
Fix error in parameter description for COM_POS_FS_PROB
Fix error in unit for COM_POS_FS_GAIN
2017-09-01 11:53:41 +02:00
Paul Riseborough 684a598d9f commander: Improve position failsafe parameter documentation 2017-09-01 11:53:41 +02:00
Paul Riseborough 491ba08af1 commander: Add parameters to control position failsafe behaviour
This is required because the hardcoded values were too sensitive for fixed wing use and bad initial mag heading could trigger the failsafe and lead to crashes on launch. The defaults have been left unchanged. Suitable values for fixed wing use will need to be implemented in the airframe specific config file.
2017-09-01 11:53:41 +02:00
Sugnan Prabhu S 6562dd496b mavlink: implement MAV_CMD_REQUEST_FLIGHT_INFORMATION
Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.com>
2017-08-31 09:26:39 +02:00
José Roberto de Souza 3fd7e3f89c modules: commander: Implement arm authorization request
If the second bit of COM_ARM_MIS_EXT_REQ is set the vehicle
will only arm after receive an authorization.

The authorization flow:
vehicle/external -> command: arm authorization request -> arm authorizer
vehicle <- command ack with result in progress <- arm authorizer
vehicle <- any data request <- arm authorizer
vehicle -> data response -> arm authorizer
vehicle <- command ack authorizing or denying <- arm authorizer

Right now there is 2 ways to start the arm authorization request,
that can be configured by COM_ARM_AUTH parameter.
- One arm: When pilot request the vehicle to arm, it will request
authorization blocking the arm process up to the timeout defined in
COM_ARM_AUTH parameter.
- Two arms request: The first arm request will request the
authorization and will deny the first arm request, if authorizer
approved the request, pilot can arm again within the authorized
time and arm without any block.

The arm authorizer can be running anywhere(compute board or PX4
itself) and it is responsible to request the mission list or any
other information to vehicle before send a final response, it
should send to vehicle a COMMAND_ACK with
result = MAV_RESULT_IN_PROGRESS as soon as it receive the arm
authorization request and the final result
as after it got all the data that it needs authorize or deny the
request.
2017-08-28 08:28:57 +02:00
José Roberto de Souza 7e3ab95975 modules: commander: Group arm requirements in just one byte and add a new requirement
Instead of having several bools to each requirement to arm, lets group then
in a byte and use bitmask.
This also add a new arm requirement "arm authorization" that
will be implemented in another patch.
2017-08-28 08:28:57 +02:00
Daniel Agar a02caff1bc unit_test inline implementation and remove module build 2017-08-23 08:06:55 +02:00
Daniel Agar 4b97e15714 commander remove orb_exists telemetry check 2017-08-21 01:30:17 +02:00
AndresRengifo 641f2f856b fix: battery prearm check ignored when CBRK_SUPPLY_CHK is disabled 2017-08-20 19:36:54 +02:00
José Roberto de Souza 4462869432 Add support to new fields in command_ack 2017-08-19 09:04:52 +02:00
Lorenz Meier 861879c6d3 Widen threshold for standard gyro consistency check
Without temperature compensation the default is too narrow.
2017-08-12 12:50:46 +02:00
Daniel Agar aa9023b72e COM_RC_STICK_OV fix broken metadata 2017-08-09 22:28:05 +02:00
Daniel Agar 1cc7f47003 COM_FLTMODE* add param group 2017-08-09 22:28:05 +02:00
José Roberto de Souza 925efe990d Initialize all outgoing vehicle_command_ack_s and vehicle_command_s
This will initialize those structs with zero in all fields not set
and all fields set will only be change once to the final value not
wasting CPU time zeroing it.

This will guarantee that no non-unitialized structs will have
a trash value on from_external causing it to be sent to the
MAVLink channel without need it.
2017-08-08 21:46:30 +02:00
José Roberto de Souza 89a428fbfe commander: Keep vehicle_command_ack_s local
No need to keep this struct as global or alive while looping.
2017-08-08 21:46:30 +02:00
Beat Küng 65e0d63ba6 commander: avoid duplicated publish, cleanup log output for offboard_mission update
- orb_advertise already publishes a struct, no need for orb_publish
- mavlink_log_critical goes to the console too
2017-08-04 18:08:51 +02:00
Lorenz Meier c94e54bbab Commander: Handle HITL state in all places consistently 2017-08-02 15:12:25 +02:00
Daniel Agar d5a890041b commander RTL failsafe should be sticky 2017-07-30 01:51:27 +02:00