AHRS using IMU (accel, gyro) only with Madwick implementation.
No detailed description...
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
<module name="ahrs_madgwick">
b'<define name="AHRS_MADWICK_IMU_ID" value="ABI_BROADCAST" />\n '
b'<configure name="AHRS_MADGWICK_TYPE" value="AHRS_PRIMARY|AHRS_SECONDARY" />\n '
b'<configure name="AHRS_ALIGNER_LED" value="1" />\n '
</module>
Module configuration options
Configure Options
- name:
AHRS_MADGWICK_TYPE
value: AHRS_PRIMARY|AHRS_SECONDARY
Description: set if the AHRS is the primary source (default) or one of the secondary sources
- name:
AHRS_ALIGNER_LED
value: 1
Description: LED number to indicate AHRS alignment, none to disable (default is board dependent)
Define Options
- name:
AHRS_MADWICK_IMU_ID
value: ABI_BROADCAST
Description: ABI sender id of IMU to use
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
Raw ahrs_madgwick.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="ahrs_madgwick" dir="ahrs" task="estimation">
<doc>
<description>
AHRS using IMU (accel, gyro) only with Madwick implementation.
</description>
<configure name="AHRS_MADGWICK_TYPE" value="AHRS_PRIMARY|AHRS_SECONDARY" description="set if the AHRS is the primary source (default) or one of the secondary sources"/>
<configure name="AHRS_ALIGNER_LED" value="1" description="LED number to indicate AHRS alignment, none to disable (default is board dependent)"/>
<define name="AHRS_MADWICK_IMU_ID" value="ABI_BROADCAST" description="ABI sender id of IMU to use"/>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="AHRS madgwick">
<dl_setting var="ahrs_madgwick_enable" min="0" step="1" max="1" module="modules/ahrs/ahrs_madgwick_wrapper" values="DISABLE|ENABLE" handler="enable"/>
<dl_setting MAX="1" MIN="1" STEP="1" VAR="ahrs_madgwick.reset" shortname="reset"/>
</dl_settings>
</dl_settings>
</settings>
<dep>
<depends>ahrs_common,@imu</depends>
<provides>ahrs</provides>
</dep>
<header>
<file name="ahrs_madgwick_wrapper.h"/>
</header>
<init fun="ahrs_madgwick_wrapper_init()"/>
<makefile target="!sim|fbw">
<configure name="AHRS_MADGWICK_TYPE" default="AHRS_PRIMARY"/>
<define name="AHRS_MADGWICK_TYPE" value="$(AHRS_MADGWICK_TYPE)"/>
<configure name="USE_MAGNETOMETER" default="0"/>
<define name="USE_MAGNETOMETER" cond="ifeq (,$(findstring $(USE_MAGNETOMETER),0 FALSE))"/>
<file name="ahrs_madgwick.c"/>
<file name="ahrs_madgwick_wrapper.c"/>
<test>
<define name="AHRS_MADGWICK_TYPE" value="AHRS_PRIMARY"/>
</test>
</makefile>
</module>