1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-1287 added handler definitions for new flightmodes

This commit is contained in:
Corvus Corax 2014-06-04 10:29:45 +02:00
parent 07667027ee
commit de7e0d0781
2 changed files with 49 additions and 11 deletions

View File

@ -66,4 +66,29 @@ void plan_setup_land();
* @brief execute land
*/
void plan_run_land();
/**
* @brief setup pathfollower for positionvario
*/
void plan_setup_PositionVarioFPV();
void plan_setup_PositionVarioLOS();
void plan_setup_PositionVarioNSEW();
/**
* @brief run for positionvario
*/
void plan_run_PositionVarioFPV();
void plan_run_PositionVarioLOS();
void plan_run_PositionVarioNSEW();
/**
* @brief setup pathplanner/pathfollower for AutoCruise
*/
void plan_setup_AutoCruise();
/**
* @brief execute AutoCruise
*/
void plan_run_AutoCruise();
#endif /* PLANS_H_ */

View File

@ -68,32 +68,45 @@ void pathFollowerHandler(bool newinit)
case FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD:
plan_setup_positionHold();
break;
case FLIGHTSTATUS_FLIGHTMODE_POSITIONVARIOFPV:
plan_setup_PositionVarioFPV();
break;
case FLIGHTSTATUS_FLIGHTMODE_POSITIONVARIOLOS:
plan_setup_PositionVarioLOS();
break;
case FLIGHTSTATUS_FLIGHTMODE_POSITIONVARIONSEW:
plan_setup_PositionVarioNSEW();
break;
case FLIGHTSTATUS_FLIGHTMODE_LAND:
plan_setup_land();
break;
case FLIGHTSTATUS_FLIGHTMODE_AUTOCRUISE:
plan_setup_AutoCruise();
break;
default:
plan_setup_positionHold();
/* Disable this section, until such time as proper discussion can be had about how to implement it for all types of crafts.
} else {
PathDesiredData pathDesired;
PathDesiredGet(&pathDesired);
pathDesired.End[PATHDESIRED_END_NORTH] += dT * -cmd->Pitch;
pathDesired.End[PATHDESIRED_END_EAST] += dT * cmd->Roll;
pathDesired.Mode = PATHDESIRED_MODE_FLYENDPOINT;
PathDesiredSet(&pathDesired);
*/
break;
}
}
switch (flightMode) {
// special handling of autoland - behaves like positon hold but with slow altitude decrease
case FLIGHTSTATUS_FLIGHTMODE_POSITIONVARIOFPV:
plan_run_PositionVarioFPV();
break;
case FLIGHTSTATUS_FLIGHTMODE_POSITIONVARIOLOS:
plan_run_PositionVarioLOS();
break;
case FLIGHTSTATUS_FLIGHTMODE_POSITIONVARIONSEW:
plan_run_PositionVarioNSEW();
break;
case FLIGHTSTATUS_FLIGHTMODE_LAND:
plan_run_land();
break;
case FLIGHTSTATUS_FLIGHTMODE_AUTOCRUISE:
plan_run_AutoCruise();
break;
default:
break;
}