|
int | collect () |
|
int | measure () |
|
int | probe_address (uint8_t address) |
| Test whether the device supported by the driver is present at a specific address. More...
|
|
void | Run () override |
| Perform a poll cycle; collect from the previous measurement and start a new one. More...
|
|
void | start () |
| Initialise the automatic measurement state machine and start it. More...
|
|
void | stop () |
| Stop the automatic measurement state machine. More...
|
|
Definition at line 89 of file srf02.cpp.
◆ SRF02()
◆ ~SRF02()
◆ collect()
Definition at line 200 of file srf02.cpp.
References _comms_errors, _distance_sensor_topic, _max_distance, _min_distance, _reports, _rotation, _sample_perf, distance_sensor_s::current_distance, f(), hrt_absolute_time(), distance_sensor_s::id, distance_sensor_s::max_distance, distance_sensor_s::min_distance, ORB_ID, orb_publish(), distance_sensor_s::orientation, perf_begin(), perf_count(), perf_end(), distance_sensor_s::signal_quality, distance_sensor_s::timestamp, distance_sensor_s::type, and distance_sensor_s::variance.
Referenced by read(), and Run().
◆ init()
Definition at line 245 of file srf02.cpp.
References _class_instance, _cycling_rate, _distance_sensor_topic, _index_counter, _orb_class_instance, _reports, _sensor_ok, addr_ind, counter, ToneAlarmInterface::init(), measure(), OK, orb_advertise_multi(), ORB_ID, ORB_PRIO_LOW, px4::Array< T, N >::push_back(), RANGE_FINDER_BASE_DEVICE_PATH, RANGE_FINDER_MAX_SENSORS, px4::Array< T, N >::size(), SRF02_BASEADDR, SRF02_CONVERSION_INTERVAL, and SRF02_INTERVAL_BETWEEN_SUCCESIVE_FIRES.
Referenced by srf02::start_bus().
◆ ioctl()
int SRF02::ioctl |
( |
device::file_t * |
filp, |
|
|
int |
cmd, |
|
|
unsigned long |
arg |
|
) |
| |
|
override |
◆ measure()
◆ print_info()
void SRF02::print_info |
( |
| ) |
|
◆ probe()
◆ probe_address()
int SRF02::probe_address |
( |
uint8_t |
address | ) |
|
|
private |
Test whether the device supported by the driver is present at a specific address.
- Parameters
-
address | The I2C bus address to probe. |
- Returns
- True if the device is present.
◆ read()
ssize_t SRF02::read |
( |
device::file_t * |
filp, |
|
|
char * |
buffer, |
|
|
size_t |
buflen |
|
) |
| |
|
override |
◆ Run()
Perform a poll cycle; collect from the previous measurement and start a new one.
Definition at line 474 of file srf02.cpp.
References _collect_phase, _cycle_counter, _cycling_rate, _index_counter, _measure_interval, addr_ind, collect(), measure(), OK, px4::Array< T, N >::size(), and start().
◆ start()
Initialise the automatic measurement state machine and start it.
- Note
- This function is called at open and error time. It might make sense to make it more aggressive about resetting the bus in case of errors.
Definition at line 525 of file srf02.cpp.
References _collect_phase, and _reports.
Referenced by ioctl(), and Run().
◆ stop()
Stop the automatic measurement state machine.
Definition at line 536 of file srf02.cpp.
Referenced by ~SRF02().
◆ _class_instance
int SRF02::_class_instance {-1} |
|
private |
◆ _collect_phase
bool SRF02::_collect_phase {false} |
|
private |
◆ _comms_errors
◆ _cycle_counter
uint8_t SRF02::_cycle_counter {0} |
|
private |
◆ _cycling_rate
int SRF02::_cycling_rate {0} |
|
private |
◆ _distance_sensor_topic
◆ _index_counter
uint8_t SRF02::_index_counter {0} |
|
private |
◆ _max_distance
◆ _measure_interval
int SRF02::_measure_interval {0} |
|
private |
◆ _min_distance
◆ _orb_class_instance
int SRF02::_orb_class_instance {-1} |
|
private |
◆ _reports
ringbuffer::RingBuffer* SRF02::_reports {nullptr} |
|
private |
◆ _rotation
◆ _sample_perf
◆ _sensor_ok
bool SRF02::_sensor_ok {false} |
|
private |
◆ addr_ind
The documentation for this class was generated from the following file: