Advanced Navigation Routines

From PaparazziUAV
Jump to navigation Jump to search

OSAM Team Navigation Routines

Flower

Screen shot of flower routine

The flower navigation routine flies the aircraft in a flower pattern defined by two waypoints. The center waypoint defines the center of the flower and the altitude the plane flies at. The edge waypoint defines the radius of the flower. To use this navigation routine, you need to include OSAMNav.h in your flight plan and OSAMNav.c to your airframe file. Then you can add flower to your flight plan like so...

   <block name="Flower">
     <call fun="InitializeFlower(WP_Center,WP_Edge)"/>
     <call fun="FlowerNav()"/>
   </block>




Bungee Takeoff

The bungee takeoff routine helps to automate takeoff by turning the throttle on after the bungee has been release from the hook. The only waypoint you need for this routine is the position of where the bungee is pegged to the ground. Using this waypoint, a line is drawn from the position of the aircraft (when the routine is initialized) to the bungee waypoint. This line is called the launch line. When the plane is released, it follows the launch line with the throttle off until it crosses the throttle line. The throttle line is a line perpendicular to the launch line at a distance d from the bungee waypoint (see the diagram below). When the plane crosses the throttle line, the throttle comes on. After the throttle comes on, the plane keeps going straight until it reaches a specified speed and altitude above the bungee waypoint altitude. When it reaches the takeoff speed and takeoff altitude, the next block in the flight plan is executed. The takeoff speed, takeoff altitude and the distance d from the bungee waypoint are specified in the airframe file. You will need to add those values to your airframe file like this...

 <section name="Takeoff" prefix="Takeoff_">
   <define name="Height" value="30" unit="m"/>
   <define name="Speed" value="15" unit="m/s"/>
   <define name="Distance" value="5" unit="m"/>
 </section>

To use this navigation routine, include OSAMNav.h in your flight plan and OSAMNav.c to your airframe file. Then you can add the bungee takeoff routine to your flight plan like so...

 <block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
   <call fun="InitializeBungeeTakeoff(WP_Bungee)"/>
   <call fun="BungeeTakeoff()"/>
 </block>

The stage bungeetakeoff has also been added to Flightplan.dtd so you can also use the bungee takeoff routine like this.

 <block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
   <bungeetakeoff BungeeWP="Bungee"/>
 </block>

When you are ready to use bungee takeoff, and you have the plane on the bungee ready to go, select the takeoff block to initialize the routine. You will know that the routine is successfully initialized when a line is drawn from the plane to the bungee. The only other thing to consider is that you may have to tune the distance from the bungee to the throttle line for consistent success.

Polygon Survey

Sweep Definition

With this navigation routine, an aircraft can survey the area of any convex polygon given an entry point, the number of waypoints which define the polygon, the sweep width and the desired orientation of the sweeps.

Entry Point

The entry point is the first corner of the polygon and the point at which the aircraft will begin surveying the area. When in the entry state, the aircraft will circle around the entry point in order to smoothly transition into the first sweep. The aircraft will also keep circling around the entry point until it gets to the waypoint altitude. After the first sweep is made, the direction of the next sweep is determined by the distance of the entry point to the edges of the polygon. If there is more area above the first sweep, the aircraft will sweep up. If there is more area below the first sweep, the aircraft will sweep down.

Sweeping Back

The aircraft will keep sweeping back and forth until it reaches the end of the polygon. At this point, the aircraft will sweep back up/down the polygon halfway in between the sweeps previously made by the aircraft (just like the rectangle survey function). The aircraft will keep sweeping up and down the polygon until the user manually switches to another block.

The orientation of the sweeps can ranges from north south to east west and any where in between (0-90 degrees respectively). The side of the polygon the aircraft starts on (ex. north or south) is determined by the side of the polygon the entry point is located.

Here is how to use this navigation routine in a flight plan.

   <block name="Poly Survey">
     <call fun="InitializePolygonSurvey(WP_S1, 5, 200, 17)"/>
     <call fun="PolygonSurvey()"/>
   </block>

The parameters are the entry waypoint, the number of waypoints in the polygon, the sweep width (meters), and the desired orientation of the sweeps (degrees). The maximum number of waypoints a polygon can have is currently ten (can be changed in the code). If the number of waypoints in the polygon exceeds the maximum number, the routine will exit and move to the next block in the flight plan. The routine will also exit if the orientation is not between 0 and 90 degrees.

Here is an example of how you should declare each of the corners of the polygon.

  <waypoint alt="1453.0" name="S1" x="-546.2" y="297.4"/>
  <waypoint alt="1453.0" name="S2" x="-129.8" y="744.1"/>
  <waypoint alt="1553.0" name="S3" x="1030.5" y="535.5"/>
  <waypoint alt="1453.0" name="S4" x="523.0" y="-236.7"/>
  <waypoint alt="1453.0" name="S5" x="-285.9" y="-255.7"/>

S1 is the entry waypoint and the first corner. The other corners should be in order clockwise or counter clockwise around the polygon. Even though this group of waypoints must be declared together, where the group appears in the list of waypoints doesn't matter.

If you want the edges of the polygon to show up on the GCS, you can also declare the polygon as a sector. This is not required to run the routine.

 <sectors>
   <sector name="PolySector">
     <corner name="S1"/>
     <corner name="S2"/>
     <corner name="S3"/>
     <corner name="S4"/>
     <corner name="S5"/>
   </sector>
 </sectors>