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
dw1000_arduino module

Driver to get ranging data from Decawave DW1000 modules connected to Arduino

Decawave DW1000 modules (http://www.decawave.com/products/dwm1000-module) are Ultra-Wide-Band devices that can be used for communication and ranging. Especially, using 3 modules as anchors can provide data for a localization system based on trilateration. The DW1000 is using a SPI connection, but an arduino-compatible board can be used with the library https://github.com/thotro/arduino-dw1000 to hyde the low level drivers and provide direct ranging informations.

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="dw1000_arduino">
2  <configure name="DW1000_ARDUINO_UART" value="UARTX" />
3  <configure name="DW1000_ARDUINO_BAUD" value="B115200" />
4 </module>

Module configuration options

Configure Options

  • name: DW1000_ARDUINO_UART value: UARTX
    Description: UART on which arduino and its DW1000 module is connected
  • name: DW1000_ARDUINO_BAUD value: B115200
    Description: UART Baudrate, default to 115200

Airframe file section

  • section name: DW1000 prefix: DW1000_
    • name ANCHORS_IDS value: 1, 2, 3
      Description: Comma separated list of anchors ID
    • name ANCHORS_POS_X value: 0., 0., 5.
      Description: Comma separated list of anchors ID over X axis
    • name ANCHORS_POS_Y value: 0., 5., 0.
      Description: Comma separated list of anchors ID over Y axis
    • name ANCHORS_POS_Z value: 0., 0., 0.
      Description: Comma separated list of anchors ID over Z axis
    • name OFFSET value: 0., 0., 0.
      Description: Position offset other X, Y and Z axis
    • name SCALE value: 1., 1., 1.
      Description: Position scale factor other X, Y and Z axis
    • name INITIAL_HEADING value: 0.
      Description: Initial heading correction between anchors frame and global frame
    • name NB_ANCHORS value: 3
      Description: Set number of anchors, only 3 are required/supported at the moment

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.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw dw1000_arduino.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="dw1000_arduino" dir="decawave">
<doc>
<description>
Driver to get ranging data from Decawave DW1000 modules connected to Arduino
Decawave DW1000 modules (http://www.decawave.com/products/dwm1000-module) are Ultra-Wide-Band devices that can be used for communication and ranging.
Especially, using 3 modules as anchors can provide data for a localization system based on trilateration.
The DW1000 is using a SPI connection, but an arduino-compatible board can be used with the library https://github.com/thotro/arduino-dw1000 to hyde the low level drivers and provide direct ranging informations.
</description>
<configure name="DW1000_ARDUINO_UART" value="UARTX" description="UART on which arduino and its DW1000 module is connected"/>
<configure name="DW1000_ARDUINO_BAUD" value="B115200" description="UART Baudrate, default to 115200"/>
<section name="DW1000" prefix="DW1000_">
<define name="ANCHORS_IDS" value="1, 2, 3" type="int[]" description="Comma separated list of anchors ID"/>
<define name="ANCHORS_POS_X" value="0., 0., 5." type="float[]" description="Comma separated list of anchors ID over X axis"/>
<define name="ANCHORS_POS_Y" value="0., 5., 0." type="float[]" description="Comma separated list of anchors ID over Y axis"/>
<define name="ANCHORS_POS_Z" value="0., 0., 0." type="float[]" description="Comma separated list of anchors ID over Z axis"/>
<define name="OFFSET" value="0., 0., 0." type="float[]" description="Position offset other X, Y and Z axis"/>
<define name="SCALE" value="1., 1., 1." type="float[]" description="Position scale factor other X, Y and Z axis"/>
<define name="INITIAL_HEADING" value="0." description="Initial heading correction between anchors frame and global frame"/>
<define name="NB_ANCHORS" value="3" description="Set number of anchors, only 3 are required/supported at the moment"/>
</section>
</doc>
<header>
<file name="dw1000_arduino.h"/>
</header>
<init fun="dw1000_arduino_init()"/>
<periodic fun="dw1000_arduino_periodic()" freq="10"/>
<periodic fun="dw1000_arduino_report()" freq="10" autorun="FALSE"/>
<periodic fun="dw1000_reset_heading_ref()" freq="1" autorun="FALSE"/>
<event fun="dw1000_arduino_event()"/>
<makefile>
<configure name="DW1000_ARDUINO_UART" case="upper|lower"/>
<configure name="DW1000_ARDUINO_BAUD" default="B115200"/>
<file name="dw1000_arduino.c"/>
<file name="trilateration.c"/>
<define name="USE_$(DW1000_ARDUINO_UART_UPPER)"/>
<define name="DW1000_ARDUINO_DEV" value="$(DW1000_ARDUINO_UART_LOWER)"/>
<define name="$(DW1000_ARDUINO_UART_UPPER)_BAUD" value="$(DW1000_ARDUINO_BAUD)"/>
</makefile>
</module>