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

FIXED: ctrlLog.txt is/was logging zeros due to (int) conversion in CameraActivity.java #30

Closed
chilipeppr opened this issue Sep 13, 2020 · 1 comment

Comments

@chilipeppr
Copy link

Hey, just a heads up to anyone else running into this, but my ctrlLog.txt was logging mostly zeros and the post-processing of the autopilot was then dropping all frames. The problem turned out to be this method.

image

The problem is likely that across Java compilers the order of operations on line 845 and 846 is such that the author's Java compiler was converting to int after the multiplication occurred. In my compiler the (int) conversion was happening prior to the multiplication, so I was ending up with mostly zeros because the getLeft() and getRight() returns a float unless you're at full speed for which you get a 1. Those were the only lines where I got a value in ctrlLog.txt.

So, the fix is to put quotes around the multiplication step so it occurs first.

My ctrlLog.txt now looks like this:
image

It used to look almost completely like this:
image

@thias15
Copy link
Collaborator

thias15 commented Sep 14, 2020

Thank you very much for raising this issue. This has been fixed in dcbe88f

@thias15 thias15 closed this as completed Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants