Firmware
Classes | Namespaces | Macros | Functions | Variables
hc_sr04.cpp File Reference

Driver for the hc_sr04 sonar range finders . More...

#include <px4_config.h>
#include <px4_workqueue.h>
#include <drivers/device/device.h>
#include <px4_defines.h>
#include <containers/Array.hpp>
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <semaphore.h>
#include <string.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <perf/perf_counter.h>
#include <systemlib/err.h>
#include <drivers/drv_hrt.h>
#include <drivers/drv_range_finder.h>
#include <drivers/device/ringbuffer.h>
#include <uORB/uORB.h>
#include <uORB/topics/distance_sensor.h>

Classes

class  HC_SR04
 

Namespaces

 hc_sr04
 Local functions in support of the shell command.
 

Macros

#define SR04_MAX_RANGEFINDERS   6
 
#define SR04_ID_BASE   0x10
 
#define SR04_DEVICE_PATH   "/dev/hc_sr04"
 
#define SR04_MIN_DISTANCE   (0.10f)
 
#define SR04_MAX_DISTANCE   (4.00f)
 
#define SR04_CONVERSION_INTERVAL   100000 /* 100ms for one sonar */
 

Functions

__EXPORT int hc_sr04_main (int argc, char *argv[])
 
void hc_sr04::start ()
 Start the driver. More...
 
void hc_sr04::stop ()
 Stop the driver.
 
void hc_sr04::test ()
 Perform some basic functional tests on the driver; make sure we can collect data from the sensor in polled and automatic modes.
 
void hc_sr04::reset ()
 Reset the driver.
 
void hc_sr04::info ()
 Print a little info about the driver.
 

Variables

HC_SR04hc_sr04::g_dev
 

Detailed Description

Driver for the hc_sr04 sonar range finders .