Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
teraranger_one module

Driver for the TeraRanger One range finder (I2C)

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="teraranger_one">
2  <define name="TERARANGER_ONE_I2C_ADDR" value="0x60" />
3  <define name="TERARANGER_ONE_OFFSET" unit="m" value="0.0" />
4  <define name="USE_TERARANGER_ONE_AGL" value="TRUE|FALSE" />
5  <configure name="TERARANGER_ONE_I2C_DEV" value="i2cX" />
6 </module>

Module configuration options

Configure Options

  • name: TERARANGER_ONE_I2C_DEV value: i2cX
    Description: Select I2C bus (i2c2 by default)

Define Options

  • name: TERARANGER_ONE_I2C_ADDR value: 0x60
    Description: Select an alternate I2C address (0x60 by default)
  • name: TERARANGER_ONE_OFFSET value: 0.0
    Description: Add an offset to the measurments (0. by default)
    Description: Send data as AGL measurments to the system (TRUE by default)

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.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

  • teraranger_periodic()
    • Frequency in Hz: 50
    • Autorun: LOCK
      Periodic function automatically starts after init and can't be stopped.
  • teraranger_downlink()
    • Frequency in Hz: 10
    • Autorun: FALSE
      Periodic function is started by user command.


Header Files

The following headers are automatically included in modules.h

Source Files

Raw teraranger_one.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="teraranger_one" dir="range_finder">
<description>Driver for the TeraRanger One range finder (I2C)</description>
<configure name="TERARANGER_ONE_I2C_DEV" value="i2cX" description="Select I2C bus (i2c2 by default)"/>
<define name="TERARANGER_ONE_I2C_ADDR" value="0x60" description="Select an alternate I2C address (0x60 by default)"/>
<define name="TERARANGER_ONE_OFFSET" value="0.0" description="Add an offset to the measurments (0. by default)" unit="m"/>
<define name="USE_TERARANGER_ONE_AGL" value="TRUE|FALSE" description="Send data as AGL measurments to the system (TRUE by default)"/>
<file name="teraranger_one.h"/>
<init fun="teraranger_init()"/>
<periodic fun="teraranger_periodic()" freq="50"/>
<periodic fun="teraranger_downlink()" freq="10" autorun="FALSE"/>
<event fun="teraranger_event()"/>
<configure name="TERARANGER_ONE_I2C_DEV" default="i2c2" case="upper|lower"/>
<file name="teraranger_one.c"/>
<define name="USE_$(TERARANGER_ONE_I2C_DEV_UPPER)"/>