|
|
|
@ -143,7 +143,8 @@ private:
@@ -143,7 +143,8 @@ private:
|
|
|
|
|
int _cycling_rate; /* */ |
|
|
|
|
uint8_t _index_counter; /* temporary sonar i2c address */ |
|
|
|
|
std::vector<uint8_t> addr_ind; /* temp sonar i2c address vector */ |
|
|
|
|
std::vector<float> _latest_sonar_measurements; /* vector to store latest sonar measurements in before writing to report */ |
|
|
|
|
std::vector<float> |
|
|
|
|
_latest_sonar_measurements; /* vector to store latest sonar measurements in before writing to report */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -274,7 +275,7 @@ MB12XX::init()
@@ -274,7 +275,7 @@ MB12XX::init()
|
|
|
|
|
struct distance_sensor_s ds_report = {}; |
|
|
|
|
|
|
|
|
|
_distance_sensor_topic = orb_advertise_multi(ORB_ID(distance_sensor), &ds_report, |
|
|
|
|
&_orb_class_instance, ORB_PRIO_LOW); |
|
|
|
|
&_orb_class_instance, ORB_PRIO_LOW); |
|
|
|
|
|
|
|
|
|
if (_distance_sensor_topic == nullptr) { |
|
|
|
|
DEVICE_LOG("failed to create distance_sensor object. Did you start uOrb?"); |
|
|
|
@ -862,7 +863,7 @@ test()
@@ -862,7 +863,7 @@ test()
|
|
|
|
|
|
|
|
|
|
warnx("periodic read %u", i); |
|
|
|
|
warnx("valid %u", (float)report.current_distance > report.min_distance |
|
|
|
|
&& (float)report.current_distance < report.max_distance ? 1 : 0); |
|
|
|
|
&& (float)report.current_distance < report.max_distance ? 1 : 0); |
|
|
|
|
warnx("measurement: %0.3f", (double)report.current_distance); |
|
|
|
|
warnx("time: %llu", report.timestamp); |
|
|
|
|
} |
|
|
|
|