46 #include "mavlink_stream.h"
88 } mode_flag_stabilise_t;
128 } mode_flag_custom_t;
136 mode_flag_armed_t ARMED : 1;
137 mode_flag_manual_t MANUAL : 1;
138 mode_flag_hil_t HIL : 1;
139 mode_flag_stabilise_t STABILISE : 1;
140 mode_flag_guided_t GUIDED : 1;
141 mode_flag_auto_t AUTO : 1;
142 mode_flag_test_t TEST : 1;
143 mode_flag_custom_t CUSTOM : 1;
153 mode_flag_armed_t ARMED : 1;
154 mode_flag_manual_t MANUAL : 1;
155 mode_flag_hil_t HIL : 1;
156 mode_flag_stabilise_t STABILISE : 1;
157 mode_flag_guided_t GUIDED : 1;
158 mode_flag_auto_t AUTO : 1;
159 mode_flag_test_t TEST : 1;
160 mode_flag_custom_t CUSTOM : 1;
165 mode_flag_armed_t ARMED : 1;
166 mode_flag_manual_t MANUAL : 1;
167 mode_flag_hil_t HIL : 1;
168 mode_flag_stabilise_t STABILISE : 1;
169 mode_flag_guided_t GUIDED : 1;
170 mode_flag_auto_t AUTO : 1;
171 mode_flag_test_t TEST : 1;
172 mode_flag_custom_t CUSTOM : 1;
182 MODE_FLAG_CUSTOM = 0,
185 MODE_FLAG_GUIDED = 3,
186 MODE_FLAG_STABILISE = 4,
188 MODE_FLAG_MANUAL = 6,
193 typedef enum MAV_MODE_FLAG mav_flag_mask_t;
195 typedef enum MAV_STATE mav_state_t;
205 MAV_MODE_ATTITUDE_CONTROL = 192,
206 MAV_MODE_VELOCITY_CONTROL = 208,
207 MAV_MODE_POSITION_HOLD = 216,
208 MAV_MODE_GPS_NAVIGATION = 156
209 } mav_mode_predefined_t;
217 CUSTOM_BASE_MODE = 0,
218 CUST_CLIMB_TO_SAFE_ALT = 1,
219 CUST_FLY_TO_HOME_WP = 2,
220 CUST_CRITICAL_LAND = 4,
222 CUST_DESCENT_TO_SMALL_ALTITUDE = 8,
223 CUST_DESCENT_TO_GND = 16,
225 CUST_COLLISION_AVOIDANCE = 32
235 static inline bool mav_modes_is_armed(
const mav_mode_t mav_mode)
237 if ( mav_mode.ARMED == ARMED_ON )
254 static inline bool mav_modes_is_hil(
const mav_mode_t mav_mode)
256 if ( mav_mode.HIL == HIL_ON )
274 static inline bool mav_modes_is_manual(
const mav_mode_t mav_mode)
276 if ( mav_mode.MANUAL == MANUAL_ON )
294 static inline bool mav_modes_is_stabilise(
const mav_mode_t mav_mode)
296 if ( mav_mode.STABILISE == STABILISE_ON )
314 static inline bool mav_modes_is_guided(
const mav_mode_t mav_mode)
316 if ( mav_mode.GUIDED == GUIDED_ON )
333 static inline bool mav_modes_is_auto(
const mav_mode_t mav_mode)
335 if ( mav_mode.AUTO == AUTO_ON )
353 static inline bool mav_modes_is_test(
const mav_mode_t mav_mode)
355 if ( mav_mode.TEST == TEST_ON )
373 static inline bool mav_modes_is_custom(
const mav_mode_t mav_mode)
375 if ( mav_mode.CUSTOM == CUSTOM_ON )
395 if ( mode1.byte == mode2.byte )
418 mode1_.HIL = HIL_OFF;
419 mode2_.HIL = HIL_OFF;
421 return mav_modes_are_equal(mode1_, mode2_);
438 mode1_.ARMED = ARMED_OFF;
439 mode2_.ARMED = ARMED_OFF;
441 return mav_modes_are_equal(mode1_, mode2_);
453 static inline bool mav_modes_are_equal_wo_hil_and_armed(
const mav_mode_t mode1,
const mav_mode_t mode2)
458 mode1_.HIL = HIL_OFF;
459 mode2_.HIL = HIL_OFF;
460 mode1_.ARMED = ARMED_OFF;
461 mode2_.ARMED = ARMED_OFF;
463 return mav_modes_are_equal(mode1_, mode2_);
481 static inline mav_mode_t mav_modes_get_from_flags(
const mode_flag_armed_t armed,
const mode_flag_hil_t hil,
const mode_flag_manual_t manual,
const mode_flag_stabilise_t stabilise,
const mode_flag_guided_t guided,
const mode_flag_auto_t autoo,
const mode_flag_test_t test,
const mode_flag_custom_t custom)
487 mode.MANUAL = manual;
488 mode.STABILISE = stabilise;
489 mode.GUIDED = guided;
492 mode.CUSTOM = custom;
Definition: mav_modes.h:134
Definition: mav_modes.h:147