Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
laser_range_array module

Reads out values through uart of an laser range ring (array), containing multiple ToF IR laser range modules

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="laser_range_array">
b'<define name="LASER_RANGE_ARRAY_NUM_SENSORS" value="0" />\n '
b'<define name="LASER_RANGE_ARRAY_ORIENTATIONS" value="0,0" type="float[]" />\n '
b'<configure name="LASER_RANGE_ARRAY_PORT" value="UART2" />\n '
b'<configure name="LASER_RANGE_ARRAY_BAUD" value="38400" />\n '
</module>

Module configuration options

Configure Options

  • name: LASER_RANGE_ARRAY_PORT value: UART2
    Description: select which uart it is connected to
  • name: LASER_RANGE_ARRAY_BAUD value: 38400
    Description: set the baudrate of the uart

Define Options

  • name: LASER_RANGE_ARRAY_NUM_SENSORS value: 0
    Description: Total amount of laser range sensors on the airframe
  • name: LASER_RANGE_ARRAY_ORIENTATIONS value: 0,0
    Description: The orientation per laser range sensor in the order: elevation,heading. The array is built up like (elv_1, head_1, elv_2, head_2,...elv_n, head_n) with n=LASER_RANGE_ARRAY_NUM_SENSORS

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 laser_range_array.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="laser_range_array" dir="range_finder">
<doc>
<description>Reads out values through uart of an laser range ring (array), containing multiple ToF IR laser range modules</description>
<configure name="LASER_RANGE_ARRAY_PORT" value="UART2" description="select which uart it is connected to"/>
<configure name="LASER_RANGE_ARRAY_BAUD" value="38400" description="set the baudrate of the uart"/>
<define name="LASER_RANGE_ARRAY_NUM_SENSORS" value="0" description="Total amount of laser range sensors on the airframe"/>
<define name="LASER_RANGE_ARRAY_ORIENTATIONS" value="0,0" type="float[]" description="The orientation per laser range sensor in the order: elevation,heading. The array is built up like (elv_1, head_1, elv_2, head_2,...elv_n, head_n) with n=LASER_RANGE_ARRAY_NUM_SENSORS"/>
</doc>
<header>
<file name="laser_range_array.h"/>
</header>
<init fun="laser_range_array_init()"/>
<event fun="laser_range_array_event()"/>
<makefile>
<!-- Configure default UART port and baudrate -->
<configure name="LASER_RANGE_ARRAY_PORT" default="UART5" case="upper|lower"/>
<configure name="LASER_RANGE_ARRAY_BAUD" default="38400"/>
<!-- Enable UART and set baudrate -->
<define name="USE_$(LASER_RANGE_ARRAY_PORT_UPPER)"/>
<define name="USE_$(LASER_RANGE_ARRAY_PORT_UPPER)_TX" value="FALSE"/>
<define name="$(LASER_RANGE_ARRAY_PORT_UPPER)_BAUD" value="$(LASER_RANGE_ARRAY_BAUD)"/>
<define name="LASER_RANGE_ARRAY_PORT" value="$(LASER_RANGE_ARRAY_PORT_LOWER)"/>
<file name="laser_range_array.c"/>
<file name="pprz_transport.c" dir="pprzlink/src"/>
<test>
<define name="LASER_RANGE_ARRAY_PORT" value="uart2"/>
<define name="LASER_RANGE_ARRAY_ORIENTATIONS" value="{0}"/>
<define name="LASER_RANGE_ARRAY_NUM_SENSORS" value="1"/>
<define name="LASER_RANGE_ARRAY_SEND_AGL" value="TRUE"/>
<define name="USE_UART2"/>
</test>
</makefile>
<makefile target="nps">
<define name="NPS_SIMULATE_LASER_RANGE_ARRAY" value="1"/>
</makefile>
</module>