This module keeps track of the current state of a rotating wing drone and desired state set by the RC or flightplan
Paramters are being scheduled in each change of a current state and desired state. Functions are defined in this module to call the actual state and desired state and set a desired state.
Example for airframe file
Add to your firmware section:
<module name="rotwing_state"/>
Module configuration options
Airframe file section
- section name:
ROTWING_STATE
prefix: ROTWING_STATE_
Module functions
Init Functions
These initialization functions are called once on startup.
Periodic Functions
These functions are called periodically at the specified frequency from the module periodic loop.
- rotwing_state_periodic()
- Running at maximum module frequency.
- Autorun: LOCK
Periodic function automatically starts after init and can't be stopped.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw rotwing_state.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="rotwing_state" dir="rotwing_drone">
<doc>
<description>This module keeps track of the current state of a rotating wing drone and desired state set by the RC or flightplan. Paramters are being scheduled in each change of a current state and desired state. Functions are defined in this module to call the actual state and desired state and set a desired state.</description>
<section name="ROTWING_STATE" prefix="ROTWING_STATE_">
</section>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="RotWing">
<dl_setting var="rotwing_state.nav_state" min="0" max="4" step="1" values="FORCE_HOVER|REQ_HOVER|FORCE_FW|REQ_FW|FREE" shortname="nav_state"/>
<dl_setting var="rotwing_state.fw_min_airspeed" min="0" max="50" step="0.1" shortname="fw_min_airspeed"/>
<dl_setting var="rotwing_state.cruise_airspeed" min="0" max="50" step="0.1" shortname="cruise_airspeed"/>
<dl_setting var="rotwing_state.force_skew" min="0" max="1" step="1" values="FALSE|TRUE" shortname="force_skew"/>
<dl_setting var="rotwing_state.sp_skew_angle_deg" min="0" max="90" step="1" shortname="sp_skew_angle"/>
<dl_setting var="rotwing_state.fail_skew_angle" min="0" max="1" step="1" values="OFF|ON" shortname="fail_skew"/>
<dl_setting var="rotwing_state.fail_hover_motor" min="0" max="1" step="1" values="OFF|ON" shortname="fail_hover"/>
<dl_setting var="rotwing_state.fail_pusher_motor" min="0" max="1" step="1" values="OFF|ON" shortname="fail_pusher"/>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="rotwing_state.h"/>
</header>
<init fun="rotwing_state_init()"/>
<periodic fun="rotwing_state_periodic()"/>
<makefile>
<file name="rotwing_state.c"/>
</makefile>
</module>