Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
lidar_tfmini module

TFMini Lidar driver with separate implementations for:

  • Real hardware using a single UART for communication (ap target)
  • NPS simulator (nps target)

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

<module name="lidar_tfmini">
b'<configure name="TFMINI_PORT" value="UART3" />\n '
b'<configure name="TFMINI_BAUD" value="B115200" />\n '
b'<configure name="USE_TFMINI_AGL" value="true" />\n '
b'<configure name="TFMINI_COMPENSATE_ROTATION" value="0" />\n '
b'<configure name="TFMINI_ROVER" value="0" />\n '
b'<configure name="LIDAR_OFFSET" value="0.0" />\n '
b'<configure name="LIDAR_HEIGHT" value="0.0" />\n '
b'<configure name="LIDAR_MIN_RANGE" value="0.1" />\n '
b'<configure name="LIDAR_MAX_RANGE" value="12.0" />\n '
</module>

Module configuration options

Configure Options

  • name: TFMINI_PORT value: UART3
    Description: UART device to use for lidar
  • name: TFMINI_BAUD value: B115200
    Description: baudrate of the TFMini UART port
  • name: USE_TFMINI_AGL value: true
    Description: use this lidar for AGL measurements
  • name: TFMINI_COMPENSATE_ROTATION value: 0
    Description: compensate AGL measurements for body rotation
  • name: TFMINI_ROVER value: 0
    Description: is this lidar mounted on a rover? Change the way to calculate the compensation
  • name: LIDAR_OFFSET value: 0.0
    Description: Horizontal offset from vehicle center to LIDAR [m]
  • name: LIDAR_HEIGHT value: 0.0
    Description: Vertical height from ground to LIDAR [m]
  • name: LIDAR_MIN_RANGE value: 0.1
    Description: minimum range of the lidar in meters (see datasheet)
  • name: LIDAR_MAX_RANGE value: 12.0
    Description: maximum range of the lidar in meters (see datasheet)

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

<!DOCTYPE module SYSTEM "module.dtd">
<module name="lidar_tfmini" dir="lidar">
<doc>
<description>
TFMini Lidar driver with separate implementations for:
- Real hardware using a single UART for communication (ap target)
- NPS simulator (nps target)
</description>
<configure name="TFMINI_PORT" value="UART3" description="UART device to use for lidar"/>
<configure name="TFMINI_BAUD" value="B115200" description="baudrate of the TFMini UART port"/>
<configure name="USE_TFMINI_AGL" value="true" description="use this lidar for AGL measurements"/>
<configure name="TFMINI_COMPENSATE_ROTATION" value="0" description="compensate AGL measurements for body rotation"/>
<configure name="TFMINI_ROVER" value="0" description="is this lidar mounted on a rover? Change the way to calculate the compensation"/>
<configure name="LIDAR_OFFSET" value="0.0" description="Horizontal offset from vehicle center to LIDAR [m]"/>
<configure name="LIDAR_HEIGHT" value="0.0" description="Vertical height from ground to LIDAR [m]"/>
<configure name="LIDAR_MIN_RANGE" value="0.1" description="minimum range of the lidar in meters (see datasheet)"/>
<configure name="LIDAR_MAX_RANGE" value="12.0" description="maximum range of the lidar in meters (see datasheet)"/>
</doc>
<settings>
<dl_settings NAME="Lidar TFMini">
<dl_settings NAME="Lidar">
<dl_setting MAX="1" MIN="0" STEP="1" VAR="tfmini.compensate_rotation" shortname="compensate_rotation"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="tfmini.update_agl" shortname="update_agl"/>
</dl_settings>
</dl_settings>
</settings>
<dep>
<depends>uart</depends>
<provides>sonar</provides>
</dep>
<header>
<file name="tfmini.h"/>
</header>
<init fun="tfmini_init()"/>
<event fun="tfmini_event()"/>
<makefile target="ap">
<!-- Configure default UART port and baudrate -->
<configure name="TFMINI_PORT" default="UART3" case="upper|lower"/>
<configure name="TFMINI_BAUD" default="B115200"/>
<!-- Enable UART and set baudrate -->
<define name="USE_$(TFMINI_PORT_UPPER)"/>
<define name="$(TFMINI_PORT_UPPER)_BAUD" value="$(TFMINI_BAUD)"/>
<define name="TFMINI_PORT" value="$(TFMINI_PORT_LOWER)"/>
<!-- Compensation constants -->
<configure name="LIDAR_OFFSET" default="0.0"/>
<configure name="LIDAR_HEIGHT" default="0.0"/>
<define name="LIDAR_OFFSET" value="$(LIDAR_OFFSET)"/>
<define name="LIDAR_HEIGHT" value="$(LIDAR_HEIGHT)"/>
<configure name="USE_TFMINI_AGL" default="true"/>
<configure name="TFMINI_COMPENSATE_ROTATION" default="0"/>
<configure name="TFMINI_ROVER" default="0"/>
<define name="USE_TFMINI_AGL" value="$(USE_TFMINI_AGL)"/>
<define name="TFMINI_COMPENSATE_ROTATION" value="$(TFMINI_COMPENSATE_ROTATION)"/>
<define name="TFMINI_ROVER" value="$(TFMINI_ROVER)"/>
<file name="tfmini.c"/>
</makefile>
<makefile target="nps">
<!-- Configure default UART port and baudrate -->
<configure name="TFMINI_PORT" default="UART3" case="upper|lower"/>
<configure name="TFMINI_BAUD" default="B115200"/>
<!-- Enable UART and set baudrate -->
<define name="USE_$(TFMINI_PORT_UPPER)"/>
<define name="$(TFMINI_PORT_UPPER)_BAUD" value="$(TFMINI_BAUD)"/>
<define name="TFMINI_PORT" value="$(TFMINI_PORT_LOWER)"/>
<configure name="LIDAR_MIN_RANGE" default="0.1"/>
<configure name="LIDAR_MAX_RANGE" default="12.0"/>
<define name="LIDAR_MIN_RANGE" value="$(LIDAR_MIN_RANGE)"/>
<define name="LIDAR_MAX_RANGE" value="$(LIDAR_MAX_RANGE)"/>
<file name="tfmini_nps.c"/>
</makefile>
</module>