Paparazzi UAS  v5.18.0_stable-1-g6993852-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
optical_flow_mateksys_3901_l0x module

Transfers flow X and Y and range data of the Mateksys3901-l0X sensor to the autopilot

This by the default serial connection not by connecting the debug pins on ther sensor The Data is in MSP compatible output.

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="optical_flow_mateksys_3901_l0x">
2  <define name="MATEKSYS_3901_L0X_MOTION_THRES" value="120" />
3  <define name="MATEKSYS_3901_L0X_DISTANCE_THRES" value="200" />
4  <define name="USE_MATEKSYS_3901_L0X_AGL" value="0" />
5  <define name="USE_MATEKSYS_3901_L0X_OPTICAL_FLOW" value="0" />
6  <define name="MATEKSYS_3901_L0X_COMPENSATE_ROTATION" value="0" />
7  <configure name="MATEKSYS_3901_L0X_PORT" value="UART1" />
8  <configure name="MATEKSYS_3901_L0X_BAUD" value="115200" />
9 </module>

Module configuration options

Configure Options

  • name: MATEKSYS_3901_L0X_PORT value: UART1
    Description: Set to which UART the sensor serial stream pin is connected to
  • name: MATEKSYS_3901_L0X_BAUD value: 115200
    Description: Sets the baudrate of the UART

Define Options

  • name: MATEKSYS_3901_L0X_MOTION_THRES value: 120
    Description: Sets the minimum motion quality to accept the flow measurement [0-255]
  • name: MATEKSYS_3901_L0X_DISTANCE_THRES value: 200
    Description: Sets the minimum distance quality to accept the distance measurement [0-255]
  • name: USE_MATEKSYS_3901_L0X_AGL value: 0
    Description: Send AGL measurements on ABI bus
  • name: USE_MATEKSYS_3901_L0X_OPTICAL_FLOW value: 0
    Description: Send optical flow measurements on ABI bus
  • name: MATEKSYS_3901_L0X_COMPENSATE_ROTATION value: 0
    Description: Adjust distance from ground by compensating body rotation

Module functions

Init Functions

These initialization functions are called once on startup.

Event Functions

These event functions are called in each cycle of the module event loop.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw optical_flow_mateksys_3901_l0x.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="optical_flow_mateksys_3901_l0x" dir="optical_flow">
<doc>
<description>
Transfers flow X and Y and range data of the Mateksys3901-l0X sensor to the autopilot
This by the default serial connection not by connecting the debug pins on ther sensor
The Data is in MSP compatible output.
</description>
<configure name="MATEKSYS_3901_L0X_PORT" value="UART1" description="Set to which UART the sensor serial stream pin is connected to"/>
<configure name="MATEKSYS_3901_L0X_BAUD" value="115200" description="Sets the baudrate of the UART"/>
<define name="MATEKSYS_3901_L0X_MOTION_THRES" value="120" description="Sets the minimum motion quality to accept the flow measurement [0-255]"/>
<define name="MATEKSYS_3901_L0X_DISTANCE_THRES" value="200" description="Sets the minimum distance quality to accept the distance measurement [0-255]"/>
<define name="USE_MATEKSYS_3901_L0X_AGL" value="0" description="Send AGL measurements on ABI bus"/>
<define name="USE_MATEKSYS_3901_L0X_OPTICAL_FLOW" value="0" description="Send optical flow measurements on ABI bus"/>
<define name="MATEKSYS_3901_L0X_COMPENSATE_ROTATION" value="0" description="Adjust distance from ground by compensating body rotation"/>
</doc>
<header>
<file name="mateksys_3901_l0x.h"/>
</header>
<init fun="mateksys3901l0x_init()"/>
<event fun="mateksys3901l0x_event()"/>
<makefile>
<!-- Configure default UART port and baudrate -->
<configure name="MATEKSYS_3901_L0X_PORT" default="UART3" case="upper|lower"/>
<configure name="MATEKSYS_3901_L0X_BAUD" default="B115200"/>
<!-- Enable UART and set baudrate -->
<define name="USE_$(MATEKSYS_3901_L0X_PORT_UPPER)"/>
<!-- If the driver is used on a serial port where the TX pin is not available, since the TX is not needed for this sensor it can be disabled -->
<define name="USE_$(MATEKSYS_3901_L0X_PORT)_TX" value="FALSE"/>
<define name="$(MATEKSYS_3901_L0X_PORT_UPPER)_BAUD" value="$(MATEKSYS_3901_L0X_BAUD)"/>
<define name="MATEKSYS_3901_L0X_PORT" value="$(MATEKSYS_3901_L0X_PORT_LOWER)"/>
<!-- Data processing configuration parameters -->
<define name="MATEKSYS_3901_L0X_MOTION_THRES" value="120"/>
<define name="MATEKSYS_3901_L0X_DISTANCE_THRES" value="200"/>
<define name="USE_MATEKSYS_3901_L0X_AGL" value="1"/>
<define name="USE_MATEKSYS_3901_L0X_OPTICAL_FLOW" value="1"/>
<define name="MATEKSYS_3901_L0X_COMPENSATE_ROTATION" value="0"/>
<file name="mateksys_3901_l0x.c"/>
</makefile>
<makefile target="nps|sim">
<define name="USE_SONAR" value="1"/> <!-- in NPS use a virtual sonar to simulate lidar measurements -->
</makefile>
</module>