Controllers should not access state machine anymore but access the vehicle_control_mode flags

This commit is contained in:
Julian Oes
2013-06-15 19:41:54 +02:00
parent e556649f2f
commit 9f5565de32
12 changed files with 180 additions and 166 deletions
+3
View File
@@ -98,6 +98,9 @@ ORB_DEFINE(rc_channels, struct rc_channels_s);
#include "topics/vehicle_command.h"
ORB_DEFINE(vehicle_command, struct vehicle_command_s);
#include "topics/vehicle_control_mode.h"
ORB_DEFINE(vehicle_control_mode, struct vehicle_control_mode_s);
#include "topics/vehicle_local_position_setpoint.h"
ORB_DEFINE(vehicle_local_position_setpoint, struct vehicle_local_position_setpoint_s);
@@ -58,6 +58,7 @@ struct actuator_safety_s {
bool armed; /**< Set to true if system is armed */
bool ready_to_arm; /**< Set to true if system is ready to be armed */
bool lockdown; /**< Set to true if actuators are forced to being disabled (due to emergency or HIL) */
bool hil_enabled; /**< Set to true if hardware-in-the-loop (HIL) is enabled */
};
ORB_DECLARE(actuator_safety);
@@ -61,16 +61,11 @@
*/
struct vehicle_control_mode_s
{
/* use of a counter and timestamp recommended (but not necessary) */
uint16_t counter; /**< incremented by the writing thread everytime new data is stored */
uint64_t timestamp; /**< in microseconds since system start, is set whenever the writing thread stores new data */
bool flag_external_manual_override_ok; /**< external override non-fatal for system. Only true for fixed wing */
bool flag_hil_enabled; /**< true if hardware in the loop simulation is enabled */
bool flag_armed; /**< true is motors / actuators are armed */
bool flag_safety_off; /**< true if safety is off */
bool flag_system_emergency;
bool flag_preflight_calibration;
@@ -83,7 +78,7 @@ struct vehicle_control_mode_s
bool flag_control_position_enabled; /**< true if position is controlled */
bool failsave_lowlevel; /**< Set to true if low-level failsafe mode is enabled */
bool failsave_highlevel;
bool failsave_highlevel; /**< Set to true if high-level failsafe mode is enabled */
};
/**
@@ -91,6 +86,6 @@ struct vehicle_control_mode_s
*/
/* register this as object request broker structure */
ORB_DECLARE(vehicle_status);
ORB_DECLARE(vehicle_control_mode);
#endif
+9 -9
View File
@@ -199,18 +199,18 @@ struct vehicle_status_s
bool flag_external_manual_override_ok; /**< external override non-fatal for system. Only true for fixed wing */
bool flag_hil_enabled; /**< true if hardware in the loop simulation is enabled */
bool flag_armed; /**< true is motors / actuators are armed */
bool flag_safety_off; /**< true if safety is off */
//bool flag_armed; /**< true is motors / actuators are armed */
//bool flag_safety_off; /**< true if safety is off */
bool flag_system_emergency;
bool flag_preflight_calibration;
bool flag_control_manual_enabled; /**< true if manual input is mixed in */
bool flag_control_offboard_enabled; /**< true if offboard control input is on */
bool flag_auto_enabled;
bool flag_control_rates_enabled; /**< true if rates are stabilized */
bool flag_control_attitude_enabled; /**< true if attitude stabilization is mixed in */
bool flag_control_velocity_enabled; /**< true if speed (implies direction) is controlled */
bool flag_control_position_enabled; /**< true if position is controlled */
// bool flag_control_manual_enabled; /**< true if manual input is mixed in */
// bool flag_control_offboard_enabled; /**< true if offboard control input is on */
// bool flag_auto_enabled;
// bool flag_control_rates_enabled; /**< true if rates are stabilized */
// bool flag_control_attitude_enabled; /**< true if attitude stabilization is mixed in */
// bool flag_control_velocity_enabled; /**< true if speed (implies direction) is controlled */
// bool flag_control_position_enabled; /**< true if position is controlled */
// bool flag_preflight_gyro_calibration; /**< true if gyro calibration is requested */
// bool flag_preflight_mag_calibration; /**< true if mag calibration is requested */