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_ALIGNER_LED" value="1" />\n '
</module>
Module configuration options
Configure Options
- 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
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_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="madwick">
<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.h"/>
</header>
<makefile target="!sim|fbw">
<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"/>
<raw>
ifdef SECONDARY_AHRS
ifneq (,$(findstring $(SECONDARY_AHRS), madwick))
# this is the secondary AHRS
$(TARGET).CFLAGS += -DAHRS_SECONDARY_TYPE_H=\"modules/ahrs/ahrs_madgwick_wrapper.h\"
$(TARGET).CFLAGS += -DSECONDARY_AHRS=ahrs_madgwick
else
# this is the primary AHRS
$(TARGET).CFLAGS += -DAHRS_TYPE_H=\"modules/ahrs/ahrs_madgwick_wrapper.h\"
$(TARGET).CFLAGS += -DPRIMARY_AHRS=ahrs_madgwick
endif
else
# plain old single AHRS usage
$(TARGET).CFLAGS += -DAHRS_TYPE_H=\"modules/ahrs/ahrs_madgwick_wrapper.h\"
endif
</raw>
<test>
<define name="PRIMARY_AHRS" value="ahrs_madgwick"/>
<define name="AHRS_TYPE_H" value="modules/ahrs/ahrs_madgwick_wrapper.h" type="string"/>
</test>
</makefile>
</module>