Parameter update - Rename variables in lib

using paramter_update.py script
This commit is contained in:
bresch
2019-04-03 15:38:50 +02:00
committed by Matthias Grob
parent ec5da55107
commit b14446f0e5
40 changed files with 245 additions and 231 deletions
@@ -117,10 +117,10 @@ void FlightTaskAutoMapper::_generateLandSetpoints()
{
// Keep xy-position and go down with landspeed
_position_setpoint = Vector3f(_target(0), _target(1), NAN);
_velocity_setpoint = Vector3f(Vector3f(NAN, NAN, MPC_LAND_SPEED.get()));
_velocity_setpoint = Vector3f(Vector3f(NAN, NAN, _param_mpc_land_speed.get()));
// set constraints
_constraints.tilt = MPC_TILTMAX_LND.get();
_constraints.speed_down = MPC_LAND_SPEED.get();
_constraints.tilt = _param_mpc_tiltmax_lnd.get();
_constraints.speed_down = _param_mpc_land_speed.get();
_gear.landing_gear = landing_gear_s::GEAR_DOWN;
}
@@ -131,8 +131,8 @@ void FlightTaskAutoMapper::_generateTakeoffSetpoints()
_velocity_setpoint = Vector3f(NAN, NAN, NAN);
// limit vertical speed during takeoff
_constraints.speed_up = math::gradual(_alt_above_ground, MPC_LAND_ALT2.get(),
MPC_LAND_ALT1.get(), MPC_TKO_SPEED.get(), _constraints.speed_up);
_constraints.speed_up = math::gradual(_alt_above_ground, _param_mpc_land_alt2.get(),
_param_mpc_land_alt1.get(), _param_mpc_tko_speed.get(), _constraints.speed_up);
_gear.landing_gear = landing_gear_s::GEAR_DOWN;
}
@@ -166,7 +166,7 @@ void FlightTaskAutoMapper::updateParams()
FlightTaskAuto::updateParams();
// make sure that alt1 is above alt2
MPC_LAND_ALT1.set(math::max(MPC_LAND_ALT1.get(), MPC_LAND_ALT2.get()));
_param_mpc_land_alt1.set(math::max(_param_mpc_land_alt1.get(), _param_mpc_land_alt2.get()));
}
bool FlightTaskAutoMapper::_highEnoughForLandingGear()
@@ -55,11 +55,13 @@ protected:
float _alt_above_ground{0.0f}; /**< If home provided, then it is altitude above home, otherwise it is altitude above local position reference. */
DEFINE_PARAMETERS_CUSTOM_PARENT(FlightTaskAuto,
(ParamFloat<px4::params::MPC_LAND_SPEED>) MPC_LAND_SPEED,
(ParamFloat<px4::params::MPC_TILTMAX_LND>) MPC_TILTMAX_LND,
(ParamFloat<px4::params::MPC_LAND_ALT1>) MPC_LAND_ALT1, // altitude at which speed limit downwards reaches maximum speed
(ParamFloat<px4::params::MPC_LAND_ALT2>) MPC_LAND_ALT2, // altitude at which speed limit downwards reached minimum speed
(ParamFloat<px4::params::MPC_TKO_SPEED>) MPC_TKO_SPEED
(ParamFloat<px4::params::MPC_LAND_SPEED>) _param_mpc_land_speed,
(ParamFloat<px4::params::MPC_TILTMAX_LND>) _param_mpc_tiltmax_lnd,
(ParamFloat<px4::params::MPC_LAND_ALT1>)
_param_mpc_land_alt1, // altitude at which speed limit downwards reaches maximum speed
(ParamFloat<px4::params::MPC_LAND_ALT2>)
_param_mpc_land_alt2, // altitude at which speed limit downwards reached minimum speed
(ParamFloat<px4::params::MPC_TKO_SPEED>) _param_mpc_tko_speed
);
virtual void _generateSetpoints() = 0; /**< Generate velocity and position setpoint for following line. */