Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ahrs_madgwick module

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!

1 <module name="ahrs_madgwick">
2  <define name="AHRS_MADWICK_IMU_ID" value="ABI_BROADCAST" />
3  <configure name="AHRS_ALIGNER_LED" value="1" />
4 </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">
<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>
<header>
<file name="ahrs.h" dir="subsystems"/>
</header>
<makefile target="!sim|fbw">
<configure name="USE_MAGNETOMETER" default="0"/>
<define name="USE_MAGNETOMETER" cond="ifeq (,$(findstring $(USE_MAGNETOMETER),0 FALSE))"/>
<define name="AHRS_ALIGNER_LED" value="$(AHRS_ALIGNER_LED)" cond="ifneq ($(AHRS_ALIGNER_LED),none)"/>
<define name="USE_AHRS"/>
<define name="USE_AHRS_ALIGNER"/>
<file name="ahrs.c" dir="subsystems"/>
<file name="ahrs_aligner.c" dir="subsystems/ahrs"/>
<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>
</makefile>
</module>