flight_mode_manager: reduce error verbosity & remove mode switching

While disarmed, commander allows to be in any mode now.
This commit is contained in:
Beat Küng
2022-10-11 22:31:20 -04:00
committed by Daniel Agar
parent 31dfdea12e
commit 57c7b5e843
2 changed files with 24 additions and 139 deletions
@@ -89,8 +89,6 @@ private:
void Run() override;
void updateParams() override;
void start_flight_task();
void check_failure(bool task_failure, uint8_t nav_state);
void send_vehicle_cmd_do(uint8_t nav_state);
void handleCommand();
void generateTrajectorySetpoint(const float dt, const vehicle_local_position_s &vehicle_local_position);
void limitAltitude(trajectory_setpoint_s &setpoint, const vehicle_local_position_s &vehicle_local_position);
@@ -118,8 +116,6 @@ private:
int _initTask(FlightTaskIndex task_index);
FlightTaskIndex switchVehicleCommand(const int command);
static constexpr int NUM_FAILURE_TRIES = 10; ///< number of tries before switching to a failsafe flight task
/**
* Union with all existing tasks: we use it to make sure that only the memory of the largest existing
* task is needed, and to avoid using dynamic memory allocations.
@@ -133,8 +129,9 @@ private:
int8_t _old_landing_gear_position{landing_gear_s::GEAR_KEEP};
uint8_t _takeoff_state{takeoff_status_s::TAKEOFF_STATE_UNINITIALIZED};
int _task_failure_count{0};
uint8_t _last_vehicle_nav_state{0};
hrt_abstime _failsafe_task_activated_start{0};
bool _failsafe_task_error_printed{false};
perf_counter_t _loop_perf{perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")}; ///< loop duration performance counter
hrt_abstime _time_stamp_last_loop{0}; ///< time stamp of last loop iteration
@@ -153,7 +150,6 @@ private:
uORB::Publication<landing_gear_s> _landing_gear_pub{ORB_ID(landing_gear)};
uORB::Publication<trajectory_setpoint_s> _trajectory_setpoint_pub{ORB_ID(trajectory_setpoint)};
uORB::Publication<vehicle_command_s> _vehicle_command_pub{ORB_ID(vehicle_command)};
uORB::Publication<vehicle_command_ack_s> _vehicle_command_ack_pub{ORB_ID(vehicle_command_ack)};
uORB::Publication<vehicle_constraints_s> _vehicle_constraints_pub{ORB_ID(vehicle_constraints)};