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:
parent
65f890982e
commit
0ffb2dee02
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user