forked from Archive/PX4-Autopilot
control_mode: reorder modes according to controller cascade
This commit is contained in:
parent
6e31638817
commit
8271faedeb
|
@ -6,15 +6,15 @@ bool flag_multicopter_position_control_enabled
|
|||
bool flag_control_manual_enabled # true if manual input is mixed in
|
||||
bool flag_control_auto_enabled # true if onboard autopilot should act
|
||||
bool flag_control_offboard_enabled # true if offboard control should be used
|
||||
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_acceleration_enabled # true if acceleration is controlled
|
||||
bool flag_control_velocity_enabled # true if horizontal velocity (implies direction) is controlled
|
||||
bool flag_control_position_enabled # true if position is controlled
|
||||
bool flag_control_velocity_enabled # true if horizontal velocity (implies direction) is controlled
|
||||
bool flag_control_altitude_enabled # true if altitude is controlled
|
||||
bool flag_control_climb_rate_enabled # true if climb rate is controlled
|
||||
bool flag_control_termination_enabled # true if flighttermination is enabled
|
||||
bool flag_control_acceleration_enabled # true if acceleration is controlled
|
||||
bool flag_control_attitude_enabled # true if attitude stabilization is mixed in
|
||||
bool flag_control_rates_enabled # true if rates are stabilized
|
||||
bool flag_control_allocation_enabled # true if control allocation is enabled
|
||||
bool flag_control_termination_enabled # true if flighttermination is enabled
|
||||
|
||||
# TODO: use dedicated topic for external requests
|
||||
uint8 source_id # Mode ID (nav_state)
|
||||
|
|
|
@ -92,8 +92,8 @@ public:
|
|||
config_control_setpoint_.flag_control_altitude_enabled = true;
|
||||
config_control_setpoint_.flag_control_climb_rate_enabled = true;
|
||||
config_control_setpoint_.flag_control_acceleration_enabled = true;
|
||||
config_control_setpoint_.flag_control_rates_enabled = true;
|
||||
config_control_setpoint_.flag_control_attitude_enabled = true;
|
||||
config_control_setpoint_.flag_control_rates_enabled = true;
|
||||
config_control_setpoint_.flag_control_allocation_enabled = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,35 +50,35 @@ void getVehicleControlMode(uint8_t nav_state, uint8_t vehicle_type,
|
|||
switch (nav_state) {
|
||||
case vehicle_status_s::NAVIGATION_STATE_MANUAL:
|
||||
vehicle_control_mode.flag_control_manual_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = stabilization_required(vehicle_type);
|
||||
vehicle_control_mode.flag_control_attitude_enabled = stabilization_required(vehicle_type);
|
||||
vehicle_control_mode.flag_control_rates_enabled = stabilization_required(vehicle_type);
|
||||
vehicle_control_mode.flag_control_allocation_enabled = true;
|
||||
break;
|
||||
|
||||
case vehicle_status_s::NAVIGATION_STATE_STAB:
|
||||
vehicle_control_mode.flag_control_manual_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_allocation_enabled = true;
|
||||
break;
|
||||
|
||||
case vehicle_status_s::NAVIGATION_STATE_ALTCTL:
|
||||
vehicle_control_mode.flag_control_manual_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_altitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_climb_rate_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_allocation_enabled = true;
|
||||
break;
|
||||
|
||||
case vehicle_status_s::NAVIGATION_STATE_POSCTL:
|
||||
vehicle_control_mode.flag_control_manual_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_altitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_climb_rate_enabled = true;
|
||||
vehicle_control_mode.flag_control_position_enabled = true;
|
||||
vehicle_control_mode.flag_control_velocity_enabled = true;
|
||||
vehicle_control_mode.flag_control_altitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_climb_rate_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_allocation_enabled = true;
|
||||
break;
|
||||
|
||||
|
@ -90,12 +90,12 @@ void getVehicleControlMode(uint8_t nav_state, uint8_t vehicle_type,
|
|||
case vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF:
|
||||
case vehicle_status_s::NAVIGATION_STATE_AUTO_VTOL_TAKEOFF:
|
||||
vehicle_control_mode.flag_control_auto_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_altitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_climb_rate_enabled = true;
|
||||
vehicle_control_mode.flag_control_position_enabled = true;
|
||||
vehicle_control_mode.flag_control_velocity_enabled = true;
|
||||
vehicle_control_mode.flag_control_altitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_climb_rate_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_allocation_enabled = true;
|
||||
break;
|
||||
|
||||
|
@ -107,9 +107,9 @@ void getVehicleControlMode(uint8_t nav_state, uint8_t vehicle_type,
|
|||
|
||||
case vehicle_status_s::NAVIGATION_STATE_DESCEND:
|
||||
vehicle_control_mode.flag_control_auto_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_climb_rate_enabled = true;
|
||||
vehicle_control_mode.flag_control_attitude_enabled = true;
|
||||
vehicle_control_mode.flag_control_rates_enabled = true;
|
||||
vehicle_control_mode.flag_control_allocation_enabled = true;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue