From 0d5480e54061d8a0875652fdf26d1777702b8da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 29 Sep 2017 17:25:09 -0700 Subject: [PATCH] driver: ll40ls: Correctly instantiate with the right parameters (#8032) It was setting the rotation value to the I2C slave address causing it to not be successfully probe. Changing the constructor paramters order instead of just fix line instantiating to keep consistency with the other lidars and sonars. --- src/drivers/ll40ls/LidarLiteI2C.cpp | 2 +- src/drivers/ll40ls/LidarLiteI2C.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/drivers/ll40ls/LidarLiteI2C.cpp b/src/drivers/ll40ls/LidarLiteI2C.cpp index 84f73fba68..b50d80dd49 100644 --- a/src/drivers/ll40ls/LidarLiteI2C.cpp +++ b/src/drivers/ll40ls/LidarLiteI2C.cpp @@ -49,7 +49,7 @@ #include #include -LidarLiteI2C::LidarLiteI2C(int bus, const char *path, int address, uint8_t rotation) : +LidarLiteI2C::LidarLiteI2C(int bus, const char *path, uint8_t rotation, int address) : I2C("LL40LS", path, bus, address, 100000), _rotation(rotation), _work{}, diff --git a/src/drivers/ll40ls/LidarLiteI2C.h b/src/drivers/ll40ls/LidarLiteI2C.h index d6592b4a37..c57fec0065 100644 --- a/src/drivers/ll40ls/LidarLiteI2C.h +++ b/src/drivers/ll40ls/LidarLiteI2C.h @@ -71,8 +71,9 @@ class LidarLiteI2C : public LidarLite, public device::I2C { public: - LidarLiteI2C(int bus, const char *path, int address = LL40LS_BASEADDR, - uint8_t rotation = distance_sensor_s::ROTATION_DOWNWARD_FACING); + LidarLiteI2C(int bus, const char *path, + uint8_t rotation = distance_sensor_s::ROTATION_DOWNWARD_FACING, + int address = LL40LS_BASEADDR); virtual ~LidarLiteI2C(); int init() override;