AP_RangeFinder_VL53L0X

Hi,

the only reference to the VL53L1X lidar i found is that it is not yet supported - could anybody state what is the issue with that model? it seems like it is same i2c device - is there any reason it is not in the 3.6 build support list? I could not find anything about it on this site.

The VL53L1X does look very interesting indeed.

I took a glance at the API and there seem to be some significant differences between the VL53L0X and VL53L1X driver. Just because they both use I2C does not mean that the 0X driver automatically works for the 1X version. So basically somebody needs to write/port the VL53L1X driver to ardupilot.

1 Like

@moobsen @Paul_Atkin1
When first released, there was a ‘‘show stopper’’ on the SparkFun Github:
Because ST has chosen not to release a complete datasheet we are forced to reverse engineer the interface from their example code and I2C data stream captures.

Now I see that POLOLU released their own version 3 weeks ago, and the drivers seems to be better integrated (actually it looks a lot like the vl53l0x).: https://github.com/pololu/vl53l1x-arduino

So I just ordered one from RobotShop :slight_smile:

Very cool. :slight_smile:

You do know that ST released a sample driver under BSD-3 license?

http://www.st.com/content/st_com/en/products/embedded-software/proximity-sensors-software/stsw-img007.html#getsoftware-scroll

Yes, as written on the POLOLU github above :
Most of the functionality of this library is based on the VL53L1X API provided by ST (STSW-IMG007),

Received and tested.
It seems ok indoor

The above test is in my garage looking at different walls, below it aims at a wall an then I open the garage door to let the bright light in.
As you can see , the signal gets ‘‘flooded’’ , so it requires mode tuning, and maybe some IR filtering in order to get used outdoor.

I used this sketch on an Arduino Nano: https://github.com/pololu/vl53l1x-arduino/tree/master/examples/Continuous

1 Like

Hi , i am trying to put in vl53l0x into the i2c chain, after compass - is it supposed to work? i see board gets voltage and signal lines are at 3v, but cannot get it to show up in the copter Status output. is it guaranteed to have address 41 or can it be anything else?

also, if it is attempted to be used as a second rangefinder with a direction for front - what field in the real time data view is supposed to show its range?

This is working no problem, try removing compass just to make sure you dont get conflicting address.
As for the second rangefinder, if you use another vl053, its a little bit complicated on a FC because you have to pull the sensor shunt line low in order to change address of the second unit and there is no code for it on ardupilot, I did it on the POC using arduino: Avoidance Experiments with the POC and Benewake TFMINI

ok, thx, i wil need to setup arduino bench then to understand why it refuses to communicate.
first lidar is the tfmini on the serial port looking down, so i wanted to play with a second one on the I2C bus to look forward but so far it is not showing up no matter what. i tried to disable serial port for TFMini to make this vl053 the only lidar in the setup but sonarrange value was always 0. i can only suspect units i got from pololu may be setup differently, and it will need some work to figure out what is the deal.

If you can test with an arduino that would be best.
The setup with a TFMINI and VL53L0x should work ok, just remember that you need to CTRL-F in mission planner to see the ‘‘RADAR’’

hi, i am not sure what is the deal with this lidar.

i tried it now on 2 different FCs. on none of them it is getting recognized or works, when configured as specified.
i just finally found time to plug it to arduino board to test - i see it prints data perfectly fine and is reporting back address 41 - (i presume function below returns decimal number) and correct range from the loop as below:
void loop()
{
Serial.print(sensor.readRangeContinuousMillimeters());
Serial.print(sensor.getAddress());
if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }

Serial.println();
}

i do not know if it is important or not - but i got those sensors from pololu, and sketch uses their library. is it a same one that is in the ardupilot?

i am really lost what the heck ardupilot wants in order to work with this lidar. i have now 3.6 rc6 loaded.
configuration done as wiki states -
RNGFND_TYPE = 16 (VL53L0X)
RNGFND_ADDR = 41 (I2C Address of lidar in decimal). The sensor’s default I2C address is 0x29 hexademical which is 41 in decimal.
RNGFND_SCALING = 1
RNGFND_MIN_CM = 5
RNGFND_MAX_CM = 120. This is the distance in cm that the rangefinder can reliably read.
RNGFND_GNDCLEAR = 10

what may be missing in this thing? sonarrange always stays at 0, message on ‘bad lidar health’ is always on.

please limit the range by aiming at a distance of about 40-50 cm
You will have this error if the lidar is aomed at over 150 cm

i had lidar on the same bench where i had it with arduino, pointed at my monitor 30cm away. had perfect printout in arduino, when connected to auav x2 board - i only get bad lidar health error and sonarrange remains at 0. very puzzling, and with 0 debug capabilities in ardupilot for i2c bus - go figure.

i am not sure at all what to do - in this test lidar was the only device on i2c bus.

i have 4 of those lidars, wanted to put them on 3 models i have - as it was supposed to be so simple, just a daisy chain after compass - but it simply does not work at all, on none of models. odd.

does it all still work on your model fine with 3.6 rc6? do you power this lidar from same serial port or i2c bus port or separate? i tried now to power it from 3.3 and 5v - neither did any good. but i did not try yet to power it from a separate bec.

What FC and Firmware releases have you tried ?
I have tested them on Pixhawk - PixRacer - BeagleBone Blue
Pleas read my blog, you cannot connect more than one VL52 on a bus because the adressing is volatile

i used 2 auav x2 and a pixracer. on auav it was the only single device on the i2c bus. no use. i asked randy if it is possible to add a startup message to ardupilot to print addresses on all discovered devices on the i2c bus - i have no clue what to do next with it, as i do not see what may be failing.

on all your tests, did you power those lidars from the 5v on the same uart or from an external 5v BEC?

The VL53L0X can be powered from the FC 5 Volts no problem.
I assumed you used up to date firmware (this range finder has been added around 3.5.4, with some fixes on 3.6.rc2)

yes, all is done properly. like i already stated, i am testing this on the 3.6 rc6.

odd. it definitely sees this lidar - as i get ‘bad lidar health’ message only if this lidar is in fact connected to the i2c bus. it is same if it is after compass or without compass. if signal wires are removed or altered, or unit is removed - ‘bad lidar health’ message does not come, it is only shown if lidar is in fact connected.

could you pls post all your rngfnd params you used on this lidar? i assume nothing else is needed at all in any other param sections for it?

i tried to alter address ‘41’ into some wrong one, i think, 27 - and i still see ‘bad lidar health’ message after that, with lidar connected. i can only suspect some kind of a bug to set or use correct address 41? no clue.

Actually, the only difference is the adress that I leave to 0 because its the defaulted value

i altered address to 0 - same thing, ‘bad lidar health’. is there any way at all to extract any debug info from arducopter on this thing? any console port to connect, anything at all?