Auto - Fix cruise speed. Tested with and without SDK. Before that commit, the drone files at max speed instead of cruise speed if not precised by the SDK

This commit is contained in:
bresch 2019-04-15 12:07:20 +02:00
parent 226f3c0999
commit 93d52581ef
2 changed files with 2 additions and 10 deletions

View File

@ -63,13 +63,6 @@ void FlightTaskAutoLineSmoothVel::reActivate()
// flight task is always reset.
}
void FlightTaskAutoLineSmoothVel::_setDefaultConstraints()
{
FlightTaskAuto::_setDefaultConstraints();
_constraints.speed_xy = _param_mpc_xy_vel_max.get(); // TODO : Should be computed using heading
}
void FlightTaskAutoLineSmoothVel::_generateSetpoints()
{
_prepareSetpoints();
@ -206,8 +199,8 @@ void FlightTaskAutoLineSmoothVel::_updateTrajConstraints()
// Update the constraints of the trajectories
_trajectory[0].setMaxAccel(_param_mpc_acc_hor_max.get()); // TODO : Should be computed using heading
_trajectory[1].setMaxAccel(_param_mpc_acc_hor_max.get());
_trajectory[0].setMaxVel(_constraints.speed_xy);
_trajectory[1].setMaxVel(_constraints.speed_xy);
_trajectory[0].setMaxVel(_param_mpc_xy_vel_max.get());
_trajectory[1].setMaxVel(_param_mpc_xy_vel_max.get());
_trajectory[0].setMaxJerk(_param_mpc_jerk_min.get()); // TODO : Should be computed using heading
_trajectory[1].setMaxJerk(_param_mpc_jerk_min.get());
_trajectory[2].setMaxJerk(_param_mpc_jerk_min.get());

View File

@ -66,7 +66,6 @@ protected:
);
void _generateSetpoints() override; /**< Generate setpoints along line. */
void _setDefaultConstraints() override;
inline float _constrainOneSide(float val, float constrain);
void _checkEkfResetCounters(); /**< Reset the trajectories when the ekf resets velocity or position */