1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

bugfix in pathplanner - 3d distance not calculated correctly

This commit is contained in:
Corvus Corax 2013-07-11 14:35:37 +02:00
parent 65f890982e
commit 0ffb2dee02

View File

@ -371,7 +371,7 @@ static uint8_t conditionDistanceToTarget()
if (pathAction.ConditionParameters[1] > 0.5f) {
distance = sqrtf(powf(waypoint.Position[0] - positionState.North, 2)
+ powf(waypoint.Position[1] - positionState.East, 2)
+ powf(waypoint.Position[1] - positionState.Down, 2));
+ powf(waypoint.Position[2] - positionState.Down, 2));
} else {
distance = sqrtf(powf(waypoint.Position[0] - positionState.North, 2)
+ powf(waypoint.Position[1] - positionState.East, 2));