diff --git a/src/lib/FlightTasks/tasks/FlightTask/FlightTask.cpp b/src/lib/FlightTasks/tasks/FlightTask/FlightTask.cpp index 1693c4ab00..7963c121a8 100644 --- a/src/lib/FlightTasks/tasks/FlightTask/FlightTask.cpp +++ b/src/lib/FlightTasks/tasks/FlightTask/FlightTask.cpp @@ -6,7 +6,8 @@ constexpr uint64_t FlightTask::_timeout; // First index of empty_setpoint corresponds to time-stamp and requires a finite number. const vehicle_local_position_setpoint_s FlightTask::empty_setpoint = {0, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, {NAN, NAN, NAN}}; -const vehicle_constraints_s FlightTask::empty_constraints = {0, NAN, NAN, NAN, NAN, NAN, NAN, NAN, vehicle_constraints_s::GEAR_KEEP, {}}; +const vehicle_constraints_s FlightTask::empty_constraints = {0, NAN, NAN, NAN, NAN, NAN, NAN, NAN, {}}; +const landing_gear_s FlightTask::landing_gear_default_keep = {0, landing_gear_s::GEAR_KEEP, {}}; const vehicle_trajectory_waypoint_s FlightTask::empty_trajectory_waypoint = {0, 0, {0, 0, 0, 0, 0, 0, 0}, { {0, {NAN, NAN, NAN}, {NAN, NAN, NAN}, {NAN, NAN, NAN}, NAN, NAN, false, {0, 0, 0}}, {0, {NAN, NAN, NAN}, {NAN, NAN, NAN}, {NAN, NAN, NAN}, NAN, NAN, false, {0, 0, 0}}, @@ -148,7 +149,6 @@ void FlightTask::_setDefaultConstraints() _constraints.speed_up = MPC_Z_VEL_MAX_UP.get(); _constraints.speed_down = MPC_Z_VEL_MAX_DN.get(); _constraints.tilt = math::radians(MPC_TILTMAX_AIR.get()); - _constraints.landing_gear = vehicle_constraints_s::GEAR_KEEP; _constraints.min_distance_to_ground = NAN; _constraints.max_distance_to_ground = NAN; } diff --git a/src/lib/FlightTasks/tasks/FlightTask/FlightTask.hpp b/src/lib/FlightTasks/tasks/FlightTask/FlightTask.hpp index 9efe587ee4..b19d37506e 100644 --- a/src/lib/FlightTasks/tasks/FlightTask/FlightTask.hpp +++ b/src/lib/FlightTasks/tasks/FlightTask/FlightTask.hpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,13 @@ public: */ const vehicle_constraints_s &getConstraints() { return _constraints; } + /** + * Get landing gear position. + * The constraints can vary with task. + * @return landing gear + */ + const landing_gear_s &getGear() { return _gear; } + /** * Get avoidance desired waypoint * @return desired waypoints @@ -132,6 +140,11 @@ public: */ static const vehicle_constraints_s empty_constraints; + /** + * default landing gear state + */ + static const landing_gear_s landing_gear_default_keep; + /** * Empty desired waypoints. * All waypoints are set to NAN. @@ -215,6 +228,8 @@ protected: */ vehicle_constraints_s _constraints{}; + landing_gear_s _gear{}; + /** * Desired waypoints. * Goals set by the FCU to be sent to the obstacle avoidance system.