1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Add RTH waypoint action

This commit is contained in:
James Cotton 2012-03-11 07:33:09 -05:00
parent 3eac69e953
commit d4488512c0
2 changed files with 9 additions and 1 deletions

View File

@ -128,6 +128,14 @@ static void pathPlannerTask(void *parameters)
positionDesired.East = waypoint.Position[WAYPOINT_POSITION_EAST];
positionDesired.Down = waypoint.Position[WAYPOINT_POSITION_DOWN];
PositionDesiredSet(&positionDesired);
} else if (waypointAction == WAYPOINT_ACTION_RTH) {
// Fly back to the home location but 20 m above it
PositionDesiredData positionDesired;
PositionDesiredGet(&positionDesired);
positionDesired.North = 0;
positionDesired.East = 0;
positionDesired.Down = -20;
PositionDesiredSet(&positionDesired);
}
}
vTaskDelay(10);

View File

@ -4,7 +4,7 @@
<field name="Position" units="m" type="float" elementnames="North, East, Down"/>
<field name="Velocity" units="m/s" type="float" elementnames="North, East, Down"/>
<field name="YawDesired" units="deg" type="float" elements="1"/>
<field name="Action" units="" type="enum" elements="1" options="Next,RTH,Loiter10s"/>
<field name="Action" units="" type="enum" elements="1" options="Next,RTH,Loiter10s,Land"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="onchange" period="0"/>