Bebop Sonar driver.
Reads an anlog sonar sensor and outputs sonar distance in [m]
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
<module name="sonar_bebop">
b'<define name="USE_SONAR" value="" />\n '
b'<define name="SONAR_BEBOP_FILTER_NARROW_OBSTACLES" value="" />\n '
b'<define name="SONAR_BEBOP_FILTER_NARROW_OBSTACLES_JUMP" value="0.4" />\n '
b'<define name="SONAR_BEBOP_FILTER_NARROW_OBSTACLES_TIME" value="1.0" />\n '
</module>
Module configuration options
Define Options
- name:
USE_SONAR
value:
Description: activate use of sonar in INS extended filter (only rotorcraft)
- name:
SONAR_BEBOP_FILTER_NARROW_OBSTACLES
value:
Description: Do not return obstacles that are shorter than a given value
- name:
SONAR_BEBOP_FILTER_NARROW_OBSTACLES_JUMP
value: 0.4
Description: Sudden changes in sonar height larger than this value are neglected [unit: meters]
- name:
SONAR_BEBOP_FILTER_NARROW_OBSTACLES_TIME
value: 1.0
Description: Sudden changes in sonar height shorter than this value are neglected [unit: seconds]
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 sonar_bebop.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="sonar_bebop" dir="sonar" task="sensors">
<doc>
<description>
Bebop Sonar driver.
Reads an anlog sonar sensor and outputs sonar distance in [m]
</description>
<define name="USE_SONAR" value="" description="activate use of sonar in INS extended filter (only rotorcraft)"/>
<define name="SONAR_BEBOP_FILTER_NARROW_OBSTACLES" value="" description="Do not return obstacles that are shorter than a given value"/>
<define name="SONAR_BEBOP_FILTER_NARROW_OBSTACLES_JUMP" value="0.4" description="Sudden changes in sonar height larger than this value are neglected [unit: meters]"/>
<define name="SONAR_BEBOP_FILTER_NARROW_OBSTACLES_TIME" value="1.0" description="Sudden changes in sonar height shorter than this value are neglected [unit: seconds]"/>
</doc>
<dep>
<depends>spi_master,adc</depends>
<provides>sonar</provides>
</dep>
<header>
<file name="sonar_bebop.h"/>
</header>
<init fun="sonar_bebop_init()"/>
<event fun="sonar_bebop_event()"/>
<makefile target="ap">
<file name="sonar_bebop.c"/>
<define name="USE_SPI0" value="1"/>
<define name="USE_ADC0" value="1"/>
</makefile>
</module>