VL53L1X laser ranger AGL driver
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="sonar_vl53l1x">
2 <define name="SONAR_VL53L1X_I2C_ADDR" value="0x52" />
3 <define name="SONAR_VL53L1X_OFFSET" value="0" />
4 <define name="SONAR_VL53L1X_TIMINGBUDGET_MS" value="100" />
5 <define name="SONAR_VL53L1X_INTERMEASUREMENT_MS" value="100" />
6 <define name="SONAR_VL53L1X_DISTANCEMODE" value="2" />
7 <define name="USE_SONAR" value="" />
8 <configure name="SONAR_VL53L1X_I2C_DEV" value="i2c1" />
Module configuration options
Configure Options
- name:
SONAR_VL53L1X_I2C_DEV
value: i2c1
Description: I2C device to use for the VL53L1X sensor
Define Options
- name:
SONAR_VL53L1X_I2C_ADDR
value: 0x52
Description: I2C address
- name:
SONAR_VL53L1X_OFFSET
value: 0
Description: sensor offset in mm - default is 0
- name:
SONAR_VL53L1X_TIMINGBUDGET_MS
value: 100
Description: Timing budget per measurement
- name:
SONAR_VL53L1X_INTERMEASUREMENT_MS
value: 100
Description: Time between measurements
- name:
SONAR_VL53L1X_DISTANCEMODE
value: 2
Description: Sensor distance mode
- name:
USE_SONAR
value:
Description: activate use of sonar in INS extended filter (only rotorcraft)
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.
- sonar_vl53l1x_read()
- Frequency in Hz: 50.
- Autorun: LOCK
Periodic function automatically starts after init and can't be stopped.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw sonar_vl53l1x.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="sonar_vl53l1x" dir="sonar">
<doc>
<description>
VL53L1X laser ranger AGL driver
</description>
<configure name="SONAR_VL53L1X_I2C_DEV" value="i2c1" description="I2C device to use for the VL53L1X sensor"/>
<define name="SONAR_VL53L1X_I2C_ADDR" value="0x52" description="I2C address"/>
<define name="SONAR_VL53L1X_OFFSET" value="0" description="sensor offset in mm - default is 0"/>
<define name="SONAR_VL53L1X_TIMINGBUDGET_MS" value="100" description="Timing budget per measurement"/>
<define name="SONAR_VL53L1X_INTERMEASUREMENT_MS" value="100" description="Time between measurements"/>
<define name="SONAR_VL53L1X_DISTANCEMODE" value="2" description="Sensor distance mode"/>
<define name="USE_SONAR" value="" description="activate use of sonar in INS extended filter (only rotorcraft)"/>
</doc>
<settings>
<dl_settings>
<dl_settings name="sonar_vl53l1x">
<dl_setting var="sonar_vl53l1x.offset_mm" min="-1000" step="1" max="1000" shortname="offset_mm"/>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="sonar_vl53l1x.h"/>
</header>
<init fun="sonar_vl53l1x_init()"/>
<periodic fun="sonar_vl53l1x_read()" freq="50."/>
<event fun="sonar_vl53l1x_event()"/>
<makefile target="ap|sim">
<file name="sonar_vl53l1x.c"/>
</makefile>
<makefile target="ap">
<configure name="SONAR_VL53L1X_I2C_DEV" default="i2c1" case="lower|upper"/>
<define name="SONAR_VL53L1X_I2C_DEV" value="$(SONAR_VL53L1X_I2C_DEV_LOWER)"/>
<define name="USE_$(SONAR_VL53L1X_I2C_DEV_UPPER)"/>
<file name="vl53l1_platform.c" dir="peripherals"/>
<file name="vl53l1x_api.c" dir="peripherals"/>
<file name="vl53l1x_nonblocking.c" dir="peripherals"/>
</makefile>
</module>