Skip to content

Bug with how I reimplemented Arithmatic #20

Merged
merged 23 commits into from May 14, 2020
Merged

Bug with how I reimplemented Arithmatic #20

merged 23 commits into from May 14, 2020

Conversation

mfs16101
Copy link
Collaborator

The way I re implemented the arithmetic to "make it more intuitive" broke it. The reason I had it count up was because the arrays that would actually be holding the 8 bytes of data was being populated in order. By changing the math to go the other way, I would either have to change around the equations again, or add a funky equation into the indexing of the byte arrays. This pull request reverts the arithmetic changes.

mfs16101 and others added 22 commits May 8, 2020 13:45
There is a problem that may be cause by these changes, that being not
closing the handle, since the loop will run forever, I would have to
close the loop on some sort of exit condition. I am not sure if the
handle closes if the process is killed, if so, then I guess it should be
fine.
This reverts commit 5a9cb08.
I have no idea why exactly but the build errors only got fixed when I
changed the order of the includes in AHRSInputIOProcessor.hpp.
I added some comments explaining how I am capturing the bytes of the
Euler Angles from the message in the buffer. Quick version here, I first
capute a 2 times the size of the message into a buffer, I then search
for the begining of the message, when I find it, I then jump to the
index where the Angles are stored. I then add each group of 8 bytes for
each angle backwords into arrays to then be converted. I add them in
backwords since the AHRS is big endian and the computer we are
converting them to doubles on is little endian. After each angle's 8
bytes are storred in an array, I then cast them into doubles, where they
can then be sent. Hopefully that makes sense, feel free to ask me any
questions about it.
I fixed the math for getting the bytes for the Angles to make a bit easier to
understand. I also clarfied my comments a bit to try and make them
clearer with the explanation.
I further clarified my comments and also renamed index to dataStart to
make it more clear what it was.
Changed "index" to "dataStart" in diagram to make it more clear.
Changed the for loop to loop backwords itself so that the equations for
actually getting the bytes only use +'s. They are still basically the
same equations, but hopefully they are a little more intuitive...
When I changed the arithmetic around it messed up the indexing of the
byte arrays. The reason i went up(forward) was so that I could put it
in the array, not to do some funky math. If we don't revert these
changes the byte order will simply be wrong.
@mfs16101 mfs16101 requested a review from grf14003 May 11, 2020 23:52
@mfs16101 mfs16101 changed the base branch from master to dev May 11, 2020 23:53
@mfs16101
Copy link
Collaborator Author

Hopefully it makes sense why this needs to be reverted.

@mfs16101 mfs16101 merged commit 6c37872 into dev May 14, 2020
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant