mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 06:20:34 +08:00
control_mode: reorder modes according to controller cascade
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user