flight_tasks: pass previous setpoint as const reference

- perform setpoint checks in place to simplify and avoid copy
This commit is contained in:
Daniel Agar
2020-08-04 12:42:36 -04:00
parent e28395a58b
commit de59d6c788
26 changed files with 71 additions and 117 deletions

View File

@@ -10,7 +10,7 @@ const ekf_reset_counters_s FlightTask::zero_reset_counters = {};
const vehicle_constraints_s FlightTask::empty_constraints = {0, NAN, NAN, NAN, NAN, NAN, NAN, NAN, false, {}};
const landing_gear_s FlightTask::empty_landing_gear_default_keep = {0, landing_gear_s::GEAR_KEEP, {}};
bool FlightTask::activate(vehicle_local_position_setpoint_s last_setpoint)
bool FlightTask::activate(const vehicle_local_position_setpoint_s &last_setpoint)
{
_resetSetpoints();
_setDefaultConstraints();