contrib-drivers
contrib-drivers copied to clipboard
[driver] Add driver for Ultrasonic ranging module
I have added driver for the ultrasonic ranging module to measure the distance of the object from the sensor. I have tested this driver using HC-SR04 ultrasonic sensor. It has simple implementation and a callback listener to get the distance value in centimeters.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!
) and we'll verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
- If you signed the CLA as a corporation, please let us know the company's name.
I signed it!
CLAs look good, thanks!
Any plans to merge this PR?
@kevalpatel2106 , thanks for the PR. Are you getting reliable measurements using this driver? Android Things is not a real time OS, so there's no guarantee that a timing-sensitive protocol like the one in HCSR04 wouldn't be affected by competing threads/processes. We are working on a solution for it, and when we have it, we will work with you to review and add your driver to the official library. How does that sound?
@mangini That sounds good. I am getting almost up to 4-5 cm accuracy with this driver. I am using it one of my DIY Robocar projects. To make it real time, I am spinning two different threads. One to send the pulses and another to get the echoes.
Great. You can define different thread priority, but it still won't be real time. I will keep this PR open until we have a better way of doing it.
Good morning, We've recently added a program to let developers submit drivers from their own repository to androidthings.withgoogle.com. Can you put this change in your own repository and then submit through that site?
@Fleker Sure I will do it.