-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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 srf02 driver class. Move member variable initialization to declarations, standardize against other drivers and format. #11891
Conversation
479261e
to
4f58ed8
Compare
@philipoe , would you be willing to review this PR for me? I am trying to standardize the distance sensor drivers so that an inheritance hierarchy can be created. Thank you! |
27146d1
to
17f1694
Compare
17f1694
to
bd238fd
Compare
bd238fd
to
df27807
Compare
9d10e1b
to
5a41af0
Compare
|
||
#include <drivers/device/i2c.h> | ||
|
||
#include <sys/types.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of these includes probably aren't even needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taken care of! Thanks!
50069df
to
11d5201
Compare
11d5201
to
8a7b895
Compare
8a7b895
to
9d8a2d6
Compare
Hi @dagar, here are flight logs and plots of this PR and current master. Performance is indistinguishable to me. Flight log and plots running the SRF02 on current master in position mode varying altitude between approximately 20cm and 2.5m: https://review.px4.io/plot_app?log=246e025c-b744-4176-9bf0-cbf545d1a303 Flight log and plots running the SRF02 from this PR in position mode varying altitude between approximately 20cm and 3m: https://review.px4.io/plot_app?log=99cb01c3-62b6-4999-bdba-f7bde750b010 Please let me know if you'd like to see anything else in this PR. Thanks! |
9d8a2d6
to
003a1c9
Compare
@dagar , ping. |
003a1c9
to
83511c9
Compare
If anyone in the world can prove that this PR has issues, I would like to speak with them about my experiences :) Is there anyone out there with hardware to test this beside me? |
@philipoe , @okalachev @julianoes @bkueng , please weigh in on this PR. Thank you! |
83511c9
to
37a233f
Compare
dbf6a34
to
03423ae
Compare
03423ae
to
c3667c1
Compare
…, standardize whitespace formatting, and alphabetize/organize order of methods and variables in srf02.cpp.
c3667c1
to
546f69e
Compare
Describe problem solved by the proposed pull request
This PR migrates srf02 class member variable initialization to respective declarations, formats whitespace, and alphabetizes/organizes variable and method declarations in
srf02.cpp
.This PR is copy/paste of the variable initialization values and method declarastion along with whitespace formatting.
Describe your preferred solution
Standardizing all of the distance sensor driver variable initialization, method ordering and general style will allow for future inheritance structure work to be performed on the distance sensor driver classes.
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, #11859.
Please let me know if you have any questions on this PR. Thanks!
-Mark