Browse Source

StickAccelerationXY: change function name feasibility limit -> jerk limit

for clarity because it's more accurate.
release/1.12
Matthias Grob 4 years ago committed by Daniel Agar
parent
commit
fee4728b1f
  1. 4
      src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  2. 2
      src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.hpp

4
src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp

@ -78,7 +78,7 @@ void StickAccelerationXY::generateSetpoints(Vector2f stick_xy, const float yaw, @@ -78,7 +78,7 @@ void StickAccelerationXY::generateSetpoints(Vector2f stick_xy, const float yaw,
Sticks::limitStickUnitLengthXY(stick_xy);
Sticks::rotateIntoHeadingFrameXY(stick_xy, yaw, yaw_sp);
_acceleration_setpoint = stick_xy.emult(acceleration_scale);
applyFeasibilityLimit(dt);
applyJerkLimit(dt);
// Add drag to limit speed and brake again
Vector2f drag = calculateDrag(acceleration_scale.edivide(velocity_scale), dt, stick_xy, _velocity_setpoint);
@ -109,7 +109,7 @@ void StickAccelerationXY::getSetpoints(Vector3f &pos_sp, Vector3f &vel_sp, Vecto @@ -109,7 +109,7 @@ void StickAccelerationXY::getSetpoints(Vector3f &pos_sp, Vector3f &vel_sp, Vecto
acc_sp.xy() = _acceleration_setpoint;
}
void StickAccelerationXY::applyFeasibilityLimit(const float dt)
void StickAccelerationXY::applyJerkLimit(const float dt)
{
// Apply jerk limit - acceleration slew rate
// Scale each jerk limit with the normalized projection of the acceleration

2
src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.hpp

@ -61,7 +61,7 @@ public: @@ -61,7 +61,7 @@ public:
void getSetpoints(matrix::Vector3f &pos_sp, matrix::Vector3f &vel_sp, matrix::Vector3f &acc_sp);
private:
void applyFeasibilityLimit(const float dt);
void applyJerkLimit(const float dt);
matrix::Vector2f calculateDrag(matrix::Vector2f drag_coefficient, const float dt, const matrix::Vector2f &stick_xy,
const matrix::Vector2f &vel_sp);
void applyTiltLimit(matrix::Vector2f &acceleration);

Loading…
Cancel
Save