mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Cheat. For FW navigation when doing endpoint mode plot path from current
position to endpoint.
This commit is contained in:
parent
980111d246
commit
ccee8e09f4
@ -245,20 +245,26 @@ static void updatePathVelocity()
|
||||
VelocityActualGet(&velocityActual);
|
||||
|
||||
struct path_status progress;
|
||||
|
||||
path_progress(pathDesired.Start, pathDesired.End, &positionActual.North, &progress);
|
||||
|
||||
float groundspeed;
|
||||
float altitudeSetpoint;
|
||||
switch (pathDesired.Mode) {
|
||||
case PATHDESIRED_MODE_PATH:
|
||||
case PATHDESIRED_MODE_ENDPOINT:
|
||||
default:
|
||||
path_progress(pathDesired.Start, pathDesired.End, &positionActual.North, &progress);
|
||||
groundspeed = pathDesired.StartingVelocity + (pathDesired.EndingVelocity - pathDesired.StartingVelocity) *
|
||||
bound(progress.fractional_progress,0,1);
|
||||
altitudeSetpoint = pathDesired.Start[2] + (pathDesired.End[2] - pathDesired.Start[2]) *
|
||||
bound(progress.fractional_progress,0,1);
|
||||
break;
|
||||
case PATHDESIRED_MODE_ENDPOINT:
|
||||
path_progress(&positionActual.North, pathDesired.End, &positionActual.North, &progress);
|
||||
groundspeed = pathDesired.StartingVelocity + (pathDesired.EndingVelocity - pathDesired.StartingVelocity) *
|
||||
bound(progress.fractional_progress,0,1);
|
||||
altitudeSetpoint = pathDesired.Start[2] + (pathDesired.End[2] - pathDesired.Start[2]) *
|
||||
bound(progress.fractional_progress,0,1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// calculate velocity - can be zero if waypoints are too close
|
||||
|
Loading…
x
Reference in New Issue
Block a user