-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Fix LOITER_TURNS zero radius bug #30874
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
Conversation
178d424
to
7400a5f
Compare
ArduCopter/mode_auto.cpp
Outdated
if (!is_zero(radius_m)) { | ||
copter.circle_nav->set_radius_cm(radius_m * 100.0f); | ||
} | ||
copter.circle_nav->set_radius_cm(radius_m * 100.0f); |
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.
I wonder if there's a default radius we should set instead if radius is not > 0?
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.
if radius is 0 it should pirouette in place, IMO
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.
I think pirouette in place feels like the natural limit as loiter radius -> 0
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.
I agree - and the called code seems to think so too.
Strange thing is that the code has been doing this since 2016....
btw are these test failures flakes @peterbarker? |
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.
Yaw determination code already seems to handle this case.
ArduCopter/mode_auto.cpp
Outdated
if (!is_zero(radius_m)) { | ||
copter.circle_nav->set_radius_cm(radius_m * 100.0f); | ||
} | ||
copter.circle_nav->set_radius_cm(radius_m * 100.0f); |
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.
I agree - and the called code seems to think so too.
Strange thing is that the code has been doing this since 2016....
One was. The other is a serious (pre-existing) problem which I'm now investigating. |
6f2b1db
to
b5ef1ad
Compare
b5ef1ad
to
1f3dde4
Compare
friendly ping @rmackay9 |
Thanks! |
Fixes #19028
Yaw the copter on the spot when using a 0 radius
LOITER_TURNS
instead of using the radius from the previous time aLOITER_TURNS
was conducted.Using zero radius with a
LOITER_TURNS
falls through to the already implemented panorama mode:ardupilot/libraries/AC_WPNav/AC_Circle.cpp
Lines 371 to 373 in 4e118ca
Tested before and after in SITL and confirmed this fixes the bug.