-
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
Use return INFINITY
for FixedwingLandDetector::_get_max_altitude()
.
#12343
Conversation
return INFINITY;
to the LandDetector class _get_max_altitude()
methodreturn INFINITY;
to the LandDetector class _get_max_altitude()
method declaration
I believe the reason it was done this way was so that the land detector publications would be throttled. On publishing on change or every second. https://github.com/PX4/Firmware/blob/02b92674aeba3a76f7e3e852182a9efe50fba40b/src/modules/land_detector/LandDetector.cpp#L105 |
02b9267
to
866563b
Compare
Hi @dagar , I will attempt to outline the direct impacts of this PR to help evaluate if it should be used or not:
No impacts in the case of Rover/LandDetector. Taking into account previous If any of the other criteria are satisfied, the result is unchanged with this PR: Impacts in the case of FixedWing/LandDetector: We can place real numbers into the code for examining. Assume that the current local position is a small value, using -1m (negative Z direction for positive altitude) is sufficient for illustration: If any of the other criteria are satisfied, Iterate after positive Z displacement has occurred: For all practical purposes, the value will always stick somewhere close to 10,000. Hopefully this is useful. |
14a2d8e
to
481aa3e
Compare
481aa3e
to
02a0723
Compare
02a0723
to
dd97073
Compare
dd97073
to
a794f88
Compare
a794f88
to
3e48603
Compare
3e48603
to
fb01338
Compare
fb01338
to
37d4460
Compare
57c0c4e
to
3c6a488
Compare
Really? Not |
Hi @julianoes , thanks!
You are right about that! (Luckily, the logic impact is the same.) Here is supporting data and test code for convenience:
|
3c6a488
to
d3b4204
Compare
Rebased on current master. |
@mcsauder thanks for laying that all out! Ah, so |
…` method declaration
d3b4204
to
fb936af
Compare
return INFINITY;
to the LandDetector class _get_max_altitude()
method declarationreturn INFINITY
for FixedwingLandDetector::_get_max_altitude()
.
Thanks @julianoes ! |
Describe problem solved by the proposed pull request
This PR adds a return value to the LandDetector(Updated by #11874)_get_max_altitude()
method declaration so that implementations can be deleted from theFixedWingLandDetector
andRoverLandDetector
classes.This PR simplifies the FixedwingLandDetector
_get_max_altitude()
logic by using the LandDetector base class logic return default. A few#includes
in the land_detector module that can be deleted are also removed.Please let me know if you have any questions on this PR. Thanks!
-Mark