mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 14:58:53 +08:00
ll40ls: increase the number of samples used to find a correlation peak for LitarLite
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
This commit is contained in:
@@ -329,18 +329,26 @@ int LidarLiteI2C::measure()
|
||||
}
|
||||
|
||||
/*
|
||||
reset the sensor to power on defaults
|
||||
reset the sensor to power on defaults plus additional configurations
|
||||
*/
|
||||
int LidarLiteI2C::reset_sensor()
|
||||
{
|
||||
int ret = write_reg(LL40LS_MEASURE_REG, LL40LS_MSRREG_RESET);
|
||||
|
||||
int ret;
|
||||
ret = write_reg(LL40LS_MEASURE_REG, LL40LS_MSRREG_RESET);
|
||||
if (ret != OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// wait for sensor reset to complete
|
||||
usleep(1000);
|
||||
ret = write_reg(LL40LS_SIG_COUNT_VAL_REG, LL40LS_SIG_COUNT_VAL_MAX);
|
||||
|
||||
if (ret != OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// wait for register write to complete
|
||||
usleep(1000);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@
|
||||
#define LL40LS_SW_VERSION 0x4f
|
||||
#define LL40LS_SIGNAL_STRENGTH_REG 0x5b
|
||||
|
||||
#define LL40LS_SIG_COUNT_VAL_REG 0x02 /* Maximum acquisition count register */
|
||||
#define LL40LS_SIG_COUNT_VAL_MAX 0xFF /* Maximum acquisition count max value */
|
||||
|
||||
class LidarLiteI2C : public LidarLite, public device::I2C
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user