-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor mb12xx driver class to allow for multiple sensors. Add ability to set sensor addresses. Deprecate rignbuffer and IOCTL. #11859
Conversation
6a3448a
to
a0b4c8d
Compare
a95f741
to
3679732
Compare
9952109
to
78d532d
Compare
@DanielePettenuzzo, @jverbeke, or @ghulands would one of you be able/willing to review this PR for me? I am trying to wrangle the distance sensor drivers into a standard structure and this PR helps align them. Thank you in advance! |
a0cc1fd
to
80c92bd
Compare
f2d4333
to
b405b73
Compare
b405b73
to
ca0f422
Compare
5e1db3c
to
0fe5f92
Compare
a419724
to
de69661
Compare
de69661
to
403dbcf
Compare
@dagar, I've pushed up a commit that makes this driver mirror the mappydot driver that I helped to author. The current PX4:master implementation cannot run multiple sensors. This PR runs multiple sensors, adds the ability to set sensor addresses, and runs on interval rather than delay. These screenshots from the bench show both sensors operating together, (obviously obtaining different values). I will post flight logs tomorrow. |
69e3e0d
to
7288e72
Compare
Hi @dagar, here are flight logs and plots from PX4:master and this PR during flights ranging from ~20cm to ~4m. This PR outperforms master with a single sensor as indicated by datapoints that actually get higher than 50cm on the right side of the plot. PX4:master https://review.px4.io/plot_app?log=799c35ad-f9dc-4143-95d1-6a067cff581e This PR: https://review.px4.io/plot_app?log=8b89aa50-2228-4629-922c-843d4ba2fc29 |
@dagar , ping. |
e72b12f
to
d032a1f
Compare
…tions. Format whitespace and alphabetize/group/order var declarations. Refactor driver reset() and mb12xx_main() methods for readability. Deprecate usage of IOCTL.
… and minor formatting in the mb12xx driver.
…ion and create functionality for multiple sensors.
d032a1f
to
088ea0c
Compare
This can't possibly be any worse than the status quo, right? I've presented a dearth of data, and no one else has weighed in, that's got to count for something, right? :) |
@okalachev and @philipoe , you are the only other authors in this file. I am hoping to have this PR signed off in the next few days so that I can carry on with the generalized work this is focused on. Please weigh in! Thanks! |
I think we should pursue a fundamentally different structure for multiple instances, but let's go with this for now. Each sensor needs metadata including rotation (already handled), but also offsets. |
Agreed. I'll put some work into getting a better (re-usable) framework. I have some ideas that I will put forward once the remaining distance sensor drivers are aligned. Thank you for reviewing and accepting this PR @dagar ! |
Describe problem solved by the proposed pull request
This PR refactors the MB12XX class to allow multiple sensors to be run simultaneously, set sensor device addresses, and deprecates use of the hardware ringbuffer and IOCTL.
This PR is a major re-write/refactor with flight test validation demonstrated in the comments below.
Describe your preferred solution
This PR standardizes the MB12XX class with the MappyDot distance sensor driver. Standardizing the distance sensor drivers will allow for future inheritance structure work to be performed on the distance sensor driver classes.
This PR is additional work to promote #9279 in conjunction with #11853, #11857, #11858, et al., and remaining distance sensor driver work.
Describe possible alternatives
All of the distance sensor driver work could be accomplished in one massive PR, but breaking up work in each driver should minimize risk and reduce review effort.
Additional context
See #9279, #11853, #11857, #1858
Please let me know if you have any questions on this PR. Thanks!
-Mark