Base stabilization code for rotorcraft
Also provide the direct mode 'stabilization_none' As a durty hack, it also provides navigation and guidance: this should be done in the airframe at some point
Example for airframe file
Add to your firmware section:
<module name="stabilization_rotorcraft"/>
Module configuration options
Airframe file section
- section name:
STABILIZATION_FILTER_CMD
prefix: STABILIZATION_FILTER_CMD_
- name
ROLL_PITCH
value: 0
Description: roll and pitch command filter toggle
- name
YAW
value: 0
Description: yaw command filter toggle
- name
ROLL_CUTOFF
value: 20.0
Description: roll command filter cut-off
- name
PITCH_CUTOFF
value: 20.0
Description: pitch command filter cut-off
- name
YAW_CUTOFF
value: 20.0
Description: yaw command filter cut-off
Module functions
Init Functions
These initialization functions are called once on startup.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
- /stabilization.c
- /stabilization/stabilization_direct.c
- /stabilization/stabilization_attitude_rc_setpoint.c
- /stabilization/stabilization_attitude_quat_transformations.c
Raw stabilization_rotorcraft.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="stabilization_rotorcraft" dir="stabilization" task="control">
<doc>
<description>
Base stabilization code for rotorcraft
Also provide the direct mode 'stabilization_none'
As a durty hack, it also provides navigation and guidance: this should be done in the airframe at some point
</description>
<section name="STABILIZATION_FILTER_CMD" prefix="STABILIZATION_FILTER_CMD_">
<define name="ROLL_PITCH" value="0" description="roll and pitch command filter toggle" unit="bool"/>
<define name="YAW" value="0" description="yaw command filter toggle" unit="bool"/>
<define name="ROLL_CUTOFF" value="20.0" description="roll command filter cut-off" unit="Hz"/>
<define name="PITCH_CUTOFF" value="20.0" description="pitch command filter cut-off" unit="Hz"/>
<define name="YAW_CUTOFF" value="20.0" description="yaw command filter cut-off" unit="Hz"/>
</section>
</doc>
<dep>
<provides>stabilization</provides>
</dep>
<header>
<file name="stabilization.h" dir="firmwares/rotorcraft"/>
<file name="stabilization_direct.h"/>
</header>
<init fun="stabilization_init()"/>
<init fun="stabilization_direct_init()"/>
<makefile target="ap|nps" firmware="rotorcraft">
<file name="stabilization.c" dir="$(SRC_FIRMWARE)"/>
<file name="stabilization_direct.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<file name="stabilization_attitude_rc_setpoint.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<file name="stabilization_attitude_quat_transformations.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<test firmware="rotorcraft">
<define name="PERIODIC_FREQUENCY" value="500"/>
</test>
</makefile>
</module>