-
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
Migrate tfmini driver class member variable initialization to declarations, format whitespace and alphabetize/group/order var/method declarations #11893
Conversation
63b9893
to
86485b5
Compare
2cd457e
to
f15edbe
Compare
@ChristophTobler , would you be willing to review this PR for me? I am working to align the distance sensor drivers so that an inheritance structure can be created and code duplication can be reduced. Thanks in advance for any feedback you might have! |
ae9b17a
to
583308b
Compare
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.
Generally looks good. But I have no way of testing this
@@ -875,52 +862,44 @@ tfmini_main(int argc, char *argv[]) | |||
|
|||
default: | |||
PX4_WARN("Unknown option!"); | |||
return -1; | |||
return -PX4_ERROR; |
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.
remove -
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.
Thank you for catching that! Fixed.
goto out_error; | ||
PX4_ERR("unrecognized command"); | ||
tfmini::usage(); | ||
return -PX4_ERROR; |
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.
same
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.
Thanks! Fixed.
if (!strcmp(argv[myoptind], "start")) { | ||
if (strcmp(device_path, "") != 0) { | ||
return tfmini::start(device_path, rotation); | ||
|
||
} else { | ||
PX4_WARN("Please specify device path!"); | ||
tfmini::usage(); | ||
return -1; | ||
return -PX4_ERROR; |
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.
same
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.
Copy/paste. :} Fixed. Thanks!
583308b
to
df24a04
Compare
Thanks @thomasgubler for looking it over! I found you in the commit history, which is why I reached out. I'll ask the group on the dev call next week to try to find someone who can hardware test it. Thanks again for your time! |
I have one, gonna test tomorrow. |
9aee03e
to
efcaac4
Compare
efcaac4
to
26a2384
Compare
26a2384
to
1114f3d
Compare
7c3f1ad
to
bd1e11e
Compare
11e5d5c
to
1af3325
Compare
…uniform initialization, format whitespace, alphabetize/group/order variables and methods in tfmini.cpp.
1af3325
to
cd8e982
Compare
50e796e
to
df26ee0
Compare
Bench tested on pixhawk 4 by rotating the sensor 90 degrees to measure distance between a floor and a wall, results show behavior indistinguishable from current master: @mhkabir , would you be willing to review this PR? Thank you! |
@ChristophTobler , would you be willing to review and perhaps accept/reject this PR as well? Thank you! |
Thanks @dagar! |
Describe problem solved by the proposed pull request
This PR migrates tfmini class member variable initialization to respective declarations, formats whitespace, and alphabetizes/organizes variable and method declarations in tfmini.cpp.
This PR is primarily copy/paste of the variable initialization values and method declarations along with whitespace formatting but also includes some minor standardization of the logic in
tfmini_main()
andcycle_trampoline
variable names.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, #11891, #11892
Please let me know if you have any questions on this PR. Thanks!
-Mark