Whether the vehicle would accept the Arm, Takeoff and Start Mission guided actions. More...
#include <VehicleReadiness.h>
Classes | |
| struct | ActionFlightModes |
| Flight modes a guided action uses, as the firmware plugin performs it. More... | |
Public Types | |
| enum class | Status { Unknown , NotReady , Ready , Syncing } |
Signals | |
| void | readinessChanged () |
Public Member Functions | |
| VehicleReadiness (Vehicle *vehicle) | |
| bool | canArm () const |
| bool | canTakeoff () const |
| bool | canStartMission () const |
| Status | status () const |
| void | update () |
| Re-evaluates readiness. Vehicle calls this once the firmware's subclass is fully constructed. | |
Protected Types | |
| enum class | GuidedAction { Takeoff , StartMission } |
Protected Member Functions | |
| virtual ActionFlightModes | _actionFlightModes (GuidedAction) const |
| Firmware returns the modes its plugin uses for the action. Unknown modes fall back to the current mode. | |
| virtual bool | _canArm (bool genericCanArm) const |
| virtual bool | _canTakeoff (bool genericCanTakeoff) const |
| virtual bool | _canStartMission (bool genericCanStartMission) const |
| virtual Status | _status (Status genericStatus) const |
Protected Attributes | |
| Vehicle * | _vehicle = nullptr |
Friends | |
| class | VehicleReadinessPX4Test |
| class | VehicleReadinessTest |
Whether the vehicle would accept the Arm, Takeoff and Start Mission guided actions.
This is the single source of readiness for both the guided actions and the toolbar status. It is created by FirmwarePlugin::createVehicleReadiness, since the firmware plugin decides which flight modes each guided action arms and runs in. Every action is locked out until initial connect completes. After that readiness uses the best source available on the vehicle:
Definition at line 26 of file VehicleReadiness.h.
|
strongprotected |
| Enumerator | |
|---|---|
| Takeoff | |
| StartMission | |
Definition at line 64 of file VehicleReadiness.h.
|
strong |
Definition at line 40 of file VehicleReadiness.h.
|
explicit |
Definition at line 14 of file VehicleReadiness.cc.
References _vehicle, Vehicle::allSensorsHealthyChanged(), SettingsManager::appSettings(), Vehicle::armedChanged(), Vehicle::checkListStateChanged(), Vehicle::initialConnectComplete(), SettingsManager::instance(), Fact::rawValueChanged(), Vehicle::readyToFlyAvailableChanged(), Vehicle::readyToFlyChanged(), AutoPilotPlugin::setupCompleteChanged(), update(), HealthAndArmingCheckReport::updated(), and VehicleReadiness().
Referenced by APMVehicleReadiness::APMVehicleReadiness(), PX4VehicleReadiness::PX4VehicleReadiness(), and VehicleReadiness().
|
inlineprotectedvirtual |
Firmware returns the modes its plugin uses for the action. Unknown modes fall back to the current mode.
Reimplemented in APMVehicleReadiness, and PX4VehicleReadiness.
Definition at line 78 of file VehicleReadiness.h.
|
inlineprotectedvirtual |
Per action overrides of the generic readiness. Each is given the generic answer, which firmware can keep, tighten or replace to match how its plugin performs the action. The initial connect lockout and an enforced pre-flight checklist still apply afterwards.
Definition at line 84 of file VehicleReadiness.h.
Referenced by update().
|
inlineprotectedvirtual |
Definition at line 88 of file VehicleReadiness.h.
Referenced by update().
|
inlineprotectedvirtual |
Definition at line 86 of file VehicleReadiness.h.
Referenced by update().
Definition at line 90 of file VehicleReadiness.h.
Referenced by update().
|
inline |
|
inline |
Definition at line 53 of file VehicleReadiness.h.
|
inline |
Definition at line 51 of file VehicleReadiness.h.
|
signal |
Referenced by update().
|
inline |
Definition at line 55 of file VehicleReadiness.h.
| void VehicleReadiness::update | ( | ) |
Re-evaluates readiness. Vehicle calls this once the firmware's subclass is fully constructed.
Definition at line 189 of file VehicleReadiness.cc.
References _canArm(), _canStartMission(), _canTakeoff(), _status(), and readinessChanged().
Referenced by VehicleReadiness().
|
friend |
Definition at line 97 of file VehicleReadiness.h.
References VehicleReadinessPX4Test.
Referenced by VehicleReadinessPX4Test.
|
friend |
Definition at line 98 of file VehicleReadiness.h.
References VehicleReadinessTest.
Referenced by VehicleReadinessTest.
|
protected |
Definition at line 94 of file VehicleReadiness.h.
Referenced by APMVehicleReadiness::_actionFlightModes(), PX4VehicleReadiness::_actionFlightModes(), and VehicleReadiness().