71 bool needs_angular_velocity{
false};
72 bool needs_attitude{
false};
73 bool needs_local_altitude{
false};
74 bool needs_local_position{
false};
75 bool needs_local_position_relaxed{
false};
76 bool needs_global_position{
false};
77 bool needs_valid_mission{
false};
78 bool needs_valid_home{
false};
79 bool needs_manual_control_input{
false};
80 bool can_prevent_arming{
false};
81 bool user_selectable{
true};
83 ModeConfiguration merge(
const ModeConfiguration& other)
const {
84 ModeConfiguration config = *
this;
85 config.needs_angular_velocity =
86 config.needs_angular_velocity || other.needs_angular_velocity;
87 config.needs_attitude = config.needs_attitude || other.needs_attitude;
88 config.needs_local_altitude = config.needs_local_altitude || other.needs_local_altitude;
89 config.needs_local_position = config.needs_local_position || other.needs_local_position;
90 config.needs_local_position_relaxed =
91 config.needs_local_position_relaxed || other.needs_local_position_relaxed;
92 config.needs_global_position = config.needs_global_position || other.needs_global_position;
93 config.needs_valid_mission = config.needs_valid_mission || other.needs_valid_mission;
94 config.needs_valid_home = config.needs_valid_home || other.needs_valid_home;
95 config.needs_manual_control_input =
96 config.needs_manual_control_input || other.needs_manual_control_input;
97 config.can_prevent_arming = config.can_prevent_arming || other.can_prevent_arming;
98 config.user_selectable = config.user_selectable || other.user_selectable;
114 needs_angular_velocity = needs;
118 ModeConfiguration& needsAttitude(
bool needs =
true) {
119 needs_attitude = needs;
123 ModeConfiguration& needsLocalAltitude(
bool needs =
true) {
124 needs_local_altitude = needs;
128 ModeConfiguration& needsLocalPosition(
bool needs =
true) {
129 needs_local_position = needs;
133 ModeConfiguration& needsLocalPositionRelaxed(
bool needs =
true) {
134 needs_local_position_relaxed = needs;
138 ModeConfiguration& needsGlobalPosition(
bool needs =
true) {
139 needs_global_position = needs;
143 ModeConfiguration& needsValidMission(
bool needs =
true) {
144 needs_valid_mission = needs;
148 ModeConfiguration& needsValidHome(
bool needs =
true) {
149 needs_valid_home = needs;
153 ModeConfiguration& needsManualControlInput(
bool needs =
true) {
154 needs_manual_control_input = needs;
158 ModeConfiguration& canPreventArming(
bool can =
true) {
159 can_prevent_arming = can;
163 ModeConfiguration& userSelectable(
bool selectable =
true) {
164 user_selectable = selectable;
Mode(SDK &sdk, const std::string &mode_name, const std::vector< ModalityConfig > &controls, ModeConfiguration config=ModeConfiguration{})
Constructor to initialize a mode.
std::variant< RateSetpoint, AttitudeSetpoint, multicopter::LocalFrameDynamicsSetpoint, multicopter::BodyFrameDynamicsSetpoint, multicopter::LocalFrameGotoSetpoint, multicopter::GlobalFrameGotoSetpoint, fixedwing::DynamicsSetpoint, vtol::TransitionSetpoint > Setpoint
Type alias for representing various types of setpoints.
Definition control.hpp:70