[SOLVED] library for VL530lox LIDAR sensor

Please do not post requests
User avatar
zoomx
Posts: 541
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: stm32duino library for VL53L0X LIDAR sensor

Post by zoomx » Sun Aug 06, 2017 1:50 pm

RogerClark wrote:
Sun Aug 06, 2017 12:05 pm
I thought ST has written their own "driver" for this device, but I can't find it yet, and looking on ST's community forum, people didnt seem happy with the lack of documentation on this device
ST software is here
http://www.st.com/en/embedded-software/stsw-img005.html
but free registration is required.

I used this sensor with an Arduino and Pololu library only one time. I thought to use this sensor with the cheap robotic car sinche the ultrasonic cheap sensor work worse at 3.3v.

User avatar
RogerClark
Posts: 7448
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: stm32duino library for VL530lox LIDAR sensorn

Post by RogerClark » Sun Aug 06, 2017 10:20 pm

@zoomx

Thanks for the link. I am already register with ST ;-) so that won't be a problem.

I am interested in its uses for a variety things, and for testing I was going to try it in a robotic car.

I also need to port it to use on the Nordic nRF51 series MCU, but that looks more complicated than I imagined, as setting up the myriad of registers takes a lot of code.
I may just port the Pololu version as there is less code to modify, and it seems to run ok, especially in single shot long range mode in their library.

Ideally, I would like to see if I can test at longer ranges, for operation at night !

User avatar
Manny
Posts: 41
Joined: Wed Dec 09, 2015 3:15 pm

Re: stm32duino library for VL530lox LIDAR sensor

Post by Manny » Mon Aug 14, 2017 9:56 am

I have received a couple of VL530lox and I was going to use them to log my dirt bikes suspension travel, so I looked around for libraries and found only the two liked earlier by Adafruit and Pololu.

The Adafruit compiles and works out of the box, the only problem is that sometimes the sensor will not work without switching cycling the power off/on. A bit frustrating sometimes.

Pololu's library did not compile without some minor changes but is better in all other aspects IMHO.

Impressed by the VL530lox accuracy and speed.

User avatar
RogerClark
Posts: 7448
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: stm32duino library for VL530lox LIDAR sensor

Post by RogerClark » Mon Aug 14, 2017 10:22 am

I didn't remember needing to change anything to make the Pololu library work, but perhaps I did.

I agree the Pololu lib seems to work well, and seems to be better than the Adafruit lib.

The Adafruit lib seems to use STM's files, but the setup of these devices is the hard bit, and Pololu's setup seems better

I found the single shot mode more useful than the continuous, but I wanted to measure long distances i.e over 1m.

User avatar
Manny
Posts: 41
Joined: Wed Dec 09, 2015 3:15 pm

Re: stm32duino library for VL530lox LIDAR sensor

Post by Manny » Mon Aug 14, 2017 5:43 pm

RogerClark wrote:
Mon Aug 14, 2017 10:22 am
I didn't remember needing to change anything to make the Pololu library work, but perhaps I did.
I was getting error: call of overloaded 'write(long unsigned int)' is ambiguous with writeReg32Bit() I changed it to the following which gets rid of it...not sure if thats the best way :)

Code: Select all

// Write a 32-bit register
void VL53L0X::writeReg32Bit(uint8_t reg, uint32_t value)
{
  Wire.beginTransmission(address);
  Wire.write(reg);
  Wire.write((byte)(value >> 24) & 0xFF); // value highest byte
  Wire.write(((byte)value >> 16) & 0xFF);
  Wire.write(((byte)value >>  8) & 0xFF);
  Wire.write( (byte)value        & 0xFF); // value lowest byte
  last_status = Wire.endTransmission();
}

User avatar
RogerClark
Posts: 7448
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: stm32duino library for VL530lox LIDAR sensor

Post by RogerClark » Mon Aug 14, 2017 9:31 pm

Ah.

yes. I valuely remember that one...

I will see what I did to fix it.

User avatar
RogerClark
Posts: 7448
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [SOLVED] library for VL530lox LIDAR sensor

Post by RogerClark » Fri Aug 25, 2017 8:38 am

I think I changed the lib to use uint8_t instead of uint8

Strangely the Wire library uses uint8 as the type for Write() so "uint8" must be defined somewhere, but is not part of the include path for that library

I think this is something that probably needs to be fixed in the core

Post Reply