PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.29k stars 13.43k forks source link

Feature Request: VL53L1x Driver. vl53lxx driver is currently only for vl53l0x #11932

Open bys1123 opened 5 years ago

bys1123 commented 5 years ago

Describe the bug vl53lxx driver is currently only for vl53l0x, also vl53l1x shouldn't share the same driver. They have very different register addresses.

https://github.com/PX4/Firmware/blob/master/src/drivers/distance_sensor/vl53lxx/vl53lxx.cpp

Reference Arduino driver: https://github.com/pololu/vl53l0x-arduino/blob/master/VL53L0X.h https://github.com/pololu/vl53l1x-arduino/blob/master/VL53L1X.h ArduPilot driver: https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_RangeFinder/AP_RangeFinder_VL53L0X.cpp https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_RangeFinder/AP_RangeFinder_VL53L1X.h

Related open issue/PR

11842 #11896

mcsauder commented 5 years ago

@bys1123 , I've pushed up a commit in PR #11896 that has a shot at functioning for your needs. I do not have hardware to test with, so you might need to help me with debugging.

I've added register maps for the vl530x and vl531x sensors in respective *.h files. Please find me on slack if you can help me with testing this work.

bys1123 commented 5 years ago

@mcsauder Thanks! I'll test it today!

bys1123 commented 5 years ago

@DanielePettenuzzo We need your help.

mcsauder commented 5 years ago

The hard coded register values in the vl53lxx driver present a problem in trying to get dual functionality for the vl530x and vl531x drivers out of a single implementation. STMicro doesn't publish a register map for the vl530x sensor, and the API doesn't provide names for many of the hard-coded values, so it isn't easy to identify what exactly is taking place. It looks like we'll need a new implementation for the vl531x, so I'll do some more work to see how easily this can be accomplished. In the meantime I've reverted PR #11896 and will work on this feature in a new PR!

mcsauder commented 5 years ago

@bys1123 , I have a WIP branch here in case you can use the register maps I have condensed out of ST's APIs: https://github.com/PX4/Firmware/compare/master...mcsauder:vl53l1x_driver_creation

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mcsauder commented 5 years ago

@dagar created PR #12575 for this functionality, but I have not had a chance to test it yet.

zbynekwinkler commented 4 years ago

What is the current status of VL53L1x support? If I want to help, where should I go?

TSC21 commented 4 years ago

@zwn any progress should be followed in https://github.com/PX4/Firmware/pull/12575.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

bys1123 commented 4 years ago

12575 is closed, waiting new PR.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.