diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-23 16:33:24 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-23 16:33:24 +0100 |
commit | b14e849fc4bcf81bbffd47064e2850a929652f6d (patch) | |
tree | f8d43a8d401e5d0ab6d7aab90c3ad5904d8214bc /src | |
parent | a23c39eec414ffb9d6808e3402d21f322e14930f (diff) | |
download | px4-firmware-b14e849fc4bcf81bbffd47064e2850a929652f6d.tar.gz px4-firmware-b14e849fc4bcf81bbffd47064e2850a929652f6d.tar.bz2 px4-firmware-b14e849fc4bcf81bbffd47064e2850a929652f6d.zip |
Sonar: Set min/max distance properly, add usleep for detection
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/mb12xx/mb12xx.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/mb12xx/mb12xx.cpp b/src/drivers/mb12xx/mb12xx.cpp index 0ef81e431..a4fb7bcc2 100644 --- a/src/drivers/mb12xx/mb12xx.cpp +++ b/src/drivers/mb12xx/mb12xx.cpp @@ -277,6 +277,9 @@ MB12XX::init() } } + // XXX we should find out why we need to wait 200 ms here + usleep(200000); + /* check for connected rangefinders on each i2c port: We start from i2c base address (0x70 = 112) and count downwards So second iteration it uses i2c address 111, third iteration 110 and so on*/ @@ -606,6 +609,8 @@ MB12XX::collect() } } + report.minimum_distance = get_minimum_distance(); + report.maximum_distance = get_maximum_distance(); report.valid = si_units > get_minimum_distance() && si_units < get_maximum_distance() ? 1 : 0; /* publish it, if we are the primary */ |