Takeoff functions for bungee takeoff.
Run initialize function when the plane is on the bungee, the bungee is fully extended and you are ready to launch the plane. After initialized, the plane will follow a line drawn by the position of the plane on initialization and the position of the bungee (given in the arguments). Once the plane crosses the throttle line, which is perpendicular to the line the plane is following, and intersects the position of the bungee (plus or minus a fixed distance (BUNGEE_TAKEOFF_DISTANCE in airframe file) from the bungee just in case the bungee doesn't release exactly above the bungee) the prop will come on. The plane will then continue to follow the line until it has reached a specific height (defined in as BUNGEE_TAKEOFF_HEIGHT in airframe file) above the bungee waypoint and airspeed (defined as BUNGEE_TAKEOFF_AIRSPEED in the airframe file). The airspeed limit is only used if USE_AIRSPEED flag is defined or set to true (and assuming the airspeed is then available). It is also possible to specify the pitch angle (BUNGEE_TAKEOFF_PITCH) and the throttle (BUNGEE_TAKEOFF_THROTTLE, between 0 and 1).
Example for airframe file
Add to your firmware section:
<module name="nav_bungee_takeoff"/>
Module configuration options
Airframe file section
- section name:
BUNGEE
prefix: BUNGEE_TAKEOFF_
- name
HEIGHT
value: distance
Description: Takeoff height
- name
AIRSPEED
value: airspeed
Description: Procedures ends above this airspeed (and above HEIGHT). Only works with valid airspeed data and USE_AIRSPEED flag
- name
DISTANCE
value: distance
Description: After this distance, the throttle is activated (if above MIN_SPEED)
- name
MIN_SPEED
value: speed
Description: Throttle is activated if crossing the line above this speed
- name
PITCH
value: angle
Description: Pitch angle during the complete takeoff phase
- name
THROTTLE
value: throttle
Description: Throttle setpoint (between 0 and 1) used after crossing the throttle line
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw nav_bungee_takeoff.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="nav_bungee_takeoff" dir="nav" task="control">
<doc>
<description>
Takeoff functions for bungee takeoff.
Run initialize function when the plane is on the bungee, the bungee is fully extended and you are ready to launch the plane.
After initialized, the plane will follow a line drawn by the position of the plane on initialization and the position of the bungee (given in the arguments).
Once the plane crosses the throttle line, which is perpendicular to the line the plane is following, and intersects the position of the bungee (plus or minus a fixed distance (BUNGEE_TAKEOFF_DISTANCE in airframe file) from the bungee just in case the bungee doesn't release exactly above the bungee) the prop will come on.
The plane will then continue to follow the line until it has reached a specific height (defined in as BUNGEE_TAKEOFF_HEIGHT in airframe file) above the bungee waypoint and airspeed (defined as BUNGEE_TAKEOFF_AIRSPEED in the airframe file). The airspeed limit is only used if USE_AIRSPEED flag is defined or set to true (and assuming the airspeed is then available). It is also possible to specify the pitch angle (BUNGEE_TAKEOFF_PITCH) and the throttle (BUNGEE_TAKEOFF_THROTTLE, between 0 and 1).
</description>
<section name="BUNGEE" prefix="BUNGEE_TAKEOFF_">
<define name="HEIGHT" value="distance" unit="m" description="Takeoff height"/>
<define name="AIRSPEED" value="airspeed" unit="m/s" description="Procedures ends above this airspeed (and above HEIGHT). Only works with valid airspeed data and USE_AIRSPEED flag"/>
<define name="DISTANCE" value="distance" unit="m" description="After this distance, the throttle is activated (if above MIN_SPEED)"/>
<define name="MIN_SPEED" value="speed" unit="m/s" description="Throttle is activated if crossing the line above this speed"/>
<define name="PITCH" value="angle" unit="deg" description="Pitch angle during the complete takeoff phase"/>
<define name="THROTTLE" value="throttle" unit="normalized" description="Throttle setpoint (between 0 and 1) used after crossing the throttle line"/>
</section>
</doc>
<dep>
<depends>@navigation</depends>
</dep>
<header>
<file name="nav_bungee_takeoff.h"/>
</header>
<makefile target="ap|sim|nps">
<file name="nav_bungee_takeoff.c"/>
<test firmware="fixedwing">
<define name="CTRL_TYPE_H" value="firmwares/fixedwing/guidance/guidance_v.h" type="string"/>
</test>
</makefile>
</module>