Skip to content
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

Parameter value precision issue #10

Open
Srwoerner opened this issue Jan 20, 2022 · 3 comments
Open

Parameter value precision issue #10

Srwoerner opened this issue Jan 20, 2022 · 3 comments
Labels

Comments

@Srwoerner
Copy link
Collaborator

It seems that at some point in handling parameters Dronekit is losing some precision with decimal values.

Example: I have a copter running 4.1.1

Looking at the param MOT_SPIN_MIN, the possible values for this param are: 0.0:Low, 0.15:Default, 0.3:High. The reported value however is 0.15000000596046448.

Damn you Java with your floating point issues!

@Srwoerner Srwoerner added the bug label Jan 20, 2022
@Srwoerner Srwoerner changed the title Parameter values precision issue Parameter value precision issue Jan 20, 2022
@kellyschrock
Copy link
Owner

kellyschrock commented Jan 20, 2022

I've noticed this a lot lately. While tuning my copter, I'll do something like param set MOT_SPIN_ARM 0.05, which works. Then I do param show MOT_SPIN_ARM, and it's always some value like 0.05019652786406069. No idea why the AP wants to get all fancy with simple values, but it seems to. Note that in this particular case, I'm in a JavaScript environment, not Java. It seems to be something the AP does.

@Srwoerner
Copy link
Collaborator Author

That's interesting, and doesn't quite make sense to me. How is Mission Planner able to present the accurate value? Are they just rounding off insignificant digits?

@kellyschrock
Copy link
Owner

kellyschrock commented Jan 21, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants