mode_requirements: add manual control for manual modes

This commit is contained in:
Matthias Grob
2022-11-30 16:17:32 +01:00
committed by Beat Küng
parent 636dfdec6a
commit f498b90c41
4 changed files with 23 additions and 0 deletions
@@ -143,6 +143,21 @@ void ModeChecks::checkAndReport(const Context &context, Report &reporter)
reporter.clearCanRunBits((NavModes)reporter.failsafeFlags().mode_req_home_position);
}
if (reporter.failsafeFlags().manual_control_signal_lost && reporter.failsafeFlags().mode_req_manual_control != 0) {
/* EVENT
* @description
* Connect and enable stick input or use autonomous mode.
* <profile name="dev">
* Sticks can be enabled via <param>COM_RC_IN_MODE</param> parameter.
* </profile>
*/
reporter.armingCheckFailure((NavModes)reporter.failsafeFlags().mode_req_manual_control,
health_component_t::remote_control,
events::ID("check_modes_manual_control"),
events::Log::Critical, "No manual control input");
reporter.clearCanRunBits((NavModes)reporter.failsafeFlags().mode_req_manual_control);
}
if (reporter.failsafeFlags().mode_req_other != 0) {
// Here we expect there is already an event reported for the failing check (this is for external modes)
reporter.clearCanRunBits((NavModes)reporter.failsafeFlags().mode_req_other);