Commit Graph

301 Commits

Author SHA1 Message Date
Daniel Agar
0f6a94894d commander state machine helper fix code style 2018-03-29 10:25:56 -04:00
Daniel Agar
db7e8635a2 commander state machine helper pass battery and safety as const references 2018-03-29 10:25:56 -04:00
Daniel Agar
4ccfc280c8 commander arming_state_transition add HIL boolean 2018-03-29 10:25:56 -04:00
Daniel Agar
e395b3578f delete unused ARMING_STATE_ARMED_ERROR state 2018-03-29 10:25:56 -04:00
Daniel Agar
e29b568d33 state machine helper remove unused headers 2018-03-29 10:25:56 -04:00
Daniel Agar
bff2136db0 commander state machine helper use constexpr for strings 2018-03-29 10:25:56 -04:00
Daniel Agar
f59b7c7399 commander is_safe() use const references 2018-03-29 10:25:56 -04:00
Daniel Agar
376b5e4747 state machine helper make vehicle_status_flags const 2018-03-29 10:25:56 -04:00
Daniel Agar
8c8fe17ff3 commander delete unused main_state_prev 2018-03-29 10:25:56 -04:00
Daniel Agar
c194c1acb5 commander use const where possible
- this helps tease apart the various pieces of commander.
2018-03-29 10:25:56 -04:00
Daniel Agar
458db2e508 vehicle_global_position remove redundant evh and evv
- vehicle_status_flags condition_global_velocity_valid is also unnecessary
2018-03-05 13:20:28 -05:00
Daniel Agar
4e45d7959c commander remove gps receiver checks 2018-02-19 15:28:47 +01:00
Daniel Agar
8b0ba3c34c commander log full status flags 2018-01-28 19:28:32 +01:00
SungTae Moon
f8f95078e8 commander status reuse arming_state_names in state_machine_helper (#8667) 2018-01-27 10:22:29 -05:00
Nicolas de Palezieux
f2dbb0ad3b commander : add support for precision landing measurements 2018-01-15 10:27:23 +01:00
Daniel Agar
b1a3475ebf commander mission valid check require updated mission_result 2018-01-14 12:53:53 +01:00
Lorenz Meier
90b4afebb5 Commander: properly separate preflight check and prearm checks
We were running pre-arm checks before when not arming, which led to annoying error messages on vehicles that were on the bench or serviced on the ground. Now we really only run them when trying to arm.
2017-12-31 16:37:02 +01:00
Lorenz Meier
6a701adf3c HITL: Remove hard requirement for airframes 2017-12-30 11:24:22 +01:00
Lorenz Meier
bb516be61e Commander: Enforce correct system configuration for HITL
This is important to ensure that users are not trying to use HITL with airframes that will not work.
2017-12-30 11:24:22 +01:00
Lorenz Meier
644db1b03f State machine helper: Fix typo 2017-12-30 11:24:22 +01:00
Daniel Agar
fc7c8b4b89 vehicle_status delete engine_failure_cmd 2017-12-27 02:41:10 +08:00
Daniel Agar
17e17d79dd commander delete unused vtol_transition_failure_cmd 2017-12-27 02:41:10 +08:00
Daniel Agar
d0fba8bf8b commander delete unused data_link_lost_cmd 2017-12-27 02:41:10 +08:00
Daniel Agar
c0be801b5c commander delete unused rc_signal_lost_cmd 2017-12-27 02:41:10 +08:00
Daniel Agar
5a6cde41d5 commander delete unused gps_failure_cmd 2017-12-27 02:41:10 +08:00
Daniel Agar
294fbc46a9 commander initial class structure 2017-12-27 02:41:10 +08: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
Daniel Agar
9a9923c517 commander simplify sensors PreflightCheck 2017-10-06 16:22:53 -07:00
Daniel Agar
7a42424411 Navigator resurrect FW GPS failure navigation (#7762) 2017-09-08 12:18:59 -04: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
AndresRengifo
641f2f856b fix: battery prearm check ignored when CBRK_SUPPLY_CHK is disabled 2017-08-20 19:36:54 +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
Lorenz Meier
61b0a81bf9 HITL startup: Further simplification of boot logic in commander 2017-07-29 23:06:50 +02:00
Lorenz Meier
5838556742 HITL handling: Enforce the use of the activation parameter for HITL configuration 2017-07-29 23:06:50 +02:00
Daniel Agar
625dc67f84 commander offboard loss rc act unreachable
- coverity fix 145492
2017-06-04 02:37:09 +08:00
Daniel Agar
64ed96d81a clang-tidy readability-simplify-boolean-expr 2017-06-02 19:35:18 -04:00
Simone Guscetti
6201fb5641 commander: arming with critical battery is not allowed 2017-05-29 18:40:57 +08:00
lovettchris
47faaa5d78 Add loiter option to COM_OBL_RC_ACT (#7170) 2017-05-08 14:17:29 -04:00
Paul Riseborough
00a42abc69 commander: Add parameter to control postal fallback after loss of navigation accuracy
Also remove else if branch that cannot be accessed.
2017-05-08 09:21:38 +02:00
priseborough
8ea0b2d3c5 commander: rework posvel validity checks
Move into functions.
Reset probation time and recalculate checks if a mode change is demanded to give the operator ability to regain control as soon as possible after nav performance is regained. (+11 squashed commits)
Squashed commits:
[a4bb800] commander: enable pilot to quickly recover from loss of position accuracy
[19e16a0] commander: rework postal probation time
[f96284e] commander: rework bad pos and vel test probation time
[00d5f0c] commander: Allow EKF preflight checks to pass with moving vehicle

Separates the 'is using GPS' and the GPS quality checks.
Uses a reasonable subset of the GPS quality checks which allows checks to pass if the vehicle is moving.
[4cdfb5c] commander: remove unused variable
[349385a] commander: add EKF GPS quality checks to pre-arm checking

Only perform check if GPs checking is activated by parameter setting.
Display fault messages that makes it clear if EKF quality checks are failing or the EKF is not using GPS for another reason. We do not want to confuse this with GPS lock.
[340ae29] commander: make position invalid fail-safe more sticky

Require check to pass for 7 seconds before exiting failsafe. This is required because if GPs is failing innovation tests for a prolonged period, the EKF will periodically reset to the GPS and report good accuracy at the time of reset.
Adding this delay gives time for an underlying error condition (eg bad IMU or compass) to be re-detected.
[b04ac95] commander: Increase RAM allocation to eliminate low stack warnings
[9dca12f] commander: add missing position invalid fail-safe responses
[69f264d] commander: Update position invalid fail-safe responses

Replace separate logic for each case with a generic function
Add velocity checks.
[8e8cef1] commander: rework position validity checks

Consolidate existing checks for global and local position validity and add checking of velocity accuracy.
Enable checks to be bypassed using the CBRK_VELPOSERR parameter.
2017-05-03 08:37:14 +02:00
Daniel Agar
1913b970d7 main state auto mission don't require valid mission 2017-04-20 11:18:32 -04:00
Daniel Agar
c1d9972244 commander add parameter COM_ARM_MIS_REQ
- arm without mission on by default
2017-04-20 11:18:32 -04:00
Lorenz Meier
08cf97c687 Commander: indicate failsafe reasons more clearly 2017-04-09 12:40:34 +02:00
Beat Küng
32995a5bc1 state_machine_helper: remove unneeded code to disable sensor publication
In HIL mode we do not start the sensors anymore, so this is not needed.

Also it did not work (I did not try to find the reason, just noticed the
sensors kept publishing in HIL mode)
2017-03-10 09:00:24 +01:00
Julian Oes
24819ce7b1 commander: no datalink failsafe on ground
On SITL startup we got a datalink lost failsafe message whenever home
was initialized. The reason that in standalone SITL, there is usually no
datalink connected. However, on ground, we shouldn't really failsafe,
therefore it makes sense not to enter the state in the first place.
2017-03-08 05:33:32 +08:00
Daniel Agar
e81e6a8296 fw_att_control add rattitude mode 2017-02-18 08:03:19 +01:00
Daniel Agar
c14c9c20eb commander tests allow FW ACRO 2017-02-18 08:03:19 +01:00