Skip to content

AC_Fence: do not store radius as integers if they look like integers #29526

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

Merged

Conversation

peterbarker
Copy link
Contributor

... and a plan to get rid of this compatability code

This is why we have these two types (copied from the code):

// CIRCLE_INCLUSION_INT stores the radius an a 32-bit integer in
// metres.  This was a bug, and CIRCLE_INCLUSION was created to store
// as a 32-bit float instead.  We save as _INT in the case that the
// radius looks like an integer as a backwards-compatibility measure.
// For 4.2 we might consider only loading _INT and always saving as
// float, and in 4.3 considering _INT invalid

I don't think this is a good candidate for build_options.py - we should just auto-fix the thing in storage for a couple of versions.

@peterbarker
Copy link
Contributor Author

I've made sure going from master to this PR brings the fence in correct.

I think did a "fence save /tmp/some.fence" and loaded from that and got the same fence back.

Copy link
Contributor

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@peterbarker peterbarker force-pushed the pr/circle-int-hackery-removal branch from d2a6c78 to a259d29 Compare March 14, 2025 20:21
This is some ancient compatability code

... and a plan to get rid of this compatability code
@peterbarker peterbarker force-pushed the pr/circle-int-hackery-removal branch from a259d29 to 32414fd Compare March 15, 2025 11:35
@peterbarker peterbarker changed the title Add AC_POLYFENCE_CIRCLE_INT_SUPPORT_ENABLED AC_Fence: do not store radius as integers if they look like integers Mar 15, 2025
@peterbarker peterbarker merged commit 88d4852 into ArduPilot:master Mar 16, 2025
110 of 112 checks passed
@peterbarker peterbarker deleted the pr/circle-int-hackery-removal branch March 16, 2025 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants