Skip to content

Commit

Permalink
Traj Smoothing - make format
Browse files Browse the repository at this point in the history
  • Loading branch information
bresch committed Feb 8, 2019
1 parent f9247a0 commit f901dff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ void FlightTaskManualPositionSmoothVel::_updateSetpoints()
_smoothing[0].setCurrentPosition(_position(0));
_smoothing[1].setCurrentPosition(_position(1));
}

if (!_position_lock_z_active) {
_smoothing[2].setCurrentPosition(_position(2));
}

Vector3f pos_sp_smooth;

for (int i = 0; i < 3; ++i) {

_smoothing[i].integrate(_acceleration_setpoint(i), _vel_sp_smooth(i), pos_sp_smooth(i));
Expand All @@ -175,6 +177,7 @@ void FlightTaskManualPositionSmoothVel::_updateSetpoints()
_position_setpoint_xy_locked(1) = pos_sp_smooth(1);
_position_lock_xy_active = true;
}

if (fabsf(_vel_sp_smooth(2)) < 0.01f &&
fabsf(_acceleration_setpoint(2)) < .2f &&
fabsf(_sticks_expo(2)) <= FLT_EPSILON) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/FlightTasks/tasks/Utility/VelocitySmoothing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ float VelocitySmoothing::computeT1(float accel_prev, float vel_prev, float vel_s
if (T1_plus >= 0.f && T3_plus >= 0.f) {
T1 = T1_plus;

} else if ( T1_minus >= 0.f && T3_minus >= 0.f) {
} else if (T1_minus >= 0.f && T3_minus >= 0.f) {
T1 = T1_minus;
}

Expand Down

0 comments on commit f901dff

Please sign in to comment.