diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-31 21:12:23 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-31 21:12:23 +0200 |
commit | c9a92e603064ac2c311d7f2e62c2ac9960b0b974 (patch) | |
tree | cd6d026b494337af2c08aaff8b6fc7bb56b5400e /src | |
parent | f5f0892b7a674659fbde2f8463429996f6ebaee5 (diff) | |
parent | 84d26185df1aa3a727d0db7b06b262e756eb5248 (diff) | |
download | px4-firmware-c9a92e603064ac2c311d7f2e62c2ac9960b0b974.tar.gz px4-firmware-c9a92e603064ac2c311d7f2e62c2ac9960b0b974.tar.bz2 px4-firmware-c9a92e603064ac2c311d7f2e62c2ac9960b0b974.zip |
Merge branch 'master' into swissfang
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/sf0x/sf0x.cpp | 4 | ||||
-rw-r--r-- | src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/sf0x/sf0x.cpp b/src/drivers/sf0x/sf0x.cpp index b690938e7..d382d08d0 100644 --- a/src/drivers/sf0x/sf0x.cpp +++ b/src/drivers/sf0x/sf0x.cpp @@ -606,7 +606,7 @@ SF0X::collect() si_units = strtod(_linebuf, &end); /* we require at least four characters for a valid number */ - if (end > _linebuf + 4) { + if (end > _linebuf + 3) { valid = true; } else { si_units = -1.0f; @@ -615,7 +615,7 @@ SF0X::collect() } } - debug("val (float): %8.4f, raw: %s, valid: %s\n", (double)si_units, _linebuf, ((valid) ? "OK" : "NO")); + debug("val (float): %8.4f, raw: %s, valid: %s", (double)si_units, _linebuf, ((valid) ? "OK" : "NO")); /* done with this chunk, resetting - even if invalid */ _linebuf_index = 0; diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp index 522f5caca..c983ac6f9 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp @@ -823,7 +823,7 @@ float FixedwingPositionControl::get_relative_landingalt(float land_setpoint_alt, * the measurement is valid * the estimated relative altitude (from global altitude estimate and landing waypoint) <= range_finder_use_relative_alt */ - if (range_finder_use_relative_alt < 0 || !range_finder.valid || rel_alt_estimated > range_finder_use_relative_alt ) { + if (range_finder_use_relative_alt < 0 || !range_finder.valid || range_finder.distance > range_finder_use_relative_alt ) { return rel_alt_estimated; } |