Skip to content

Bug with how I reimplemented Arithmatic #20

Merged
merged 23 commits into from May 14, 2020
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
17bdc02
Add AHRS IO Proc files into newer pull from dev
mfs16101 May 8, 2020
ac92532
Fix names and built with python script
mfs16101 May 8, 2020
f3f13b8
Fix pull request comments
mfs16101 May 8, 2020
2f29396
Make edits for the pull request
mfs16101 May 8, 2020
3cbcf6e
Untabify AHRSInputIOProcessor.cpp
mfs16101 May 8, 2020
5a9cb08
Hmmm
mfs16101 May 8, 2020
e2ea108
Revert "Hmmm"
mfs16101 May 8, 2020
98e1ba6
Add functionality to get roll and pitch angles
mfs16101 May 8, 2020
277cb31
Change order of #includes fixed build errors...
mfs16101 May 8, 2020
c55c91a
Add Comments Explaining Byte Capture
mfs16101 May 10, 2020
6bb6f9c
Fix confusing math
mfs16101 May 10, 2020
45ae105
Fix Comments More
mfs16101 May 10, 2020
f446d77
Rename Attribute Keys
mfs16101 May 10, 2020
58a3dec
Fix type in comments
mfs16101 May 10, 2020
13c66ec
Add more specifics to Config message comments
May 11, 2020
9988615
Change arround data byte capture math
mfs16101 May 11, 2020
f50c2f1
Revert "Add more specifics to Config message comments"
mfs16101 May 11, 2020
596b9af
Revert "Change arround data byte capture math"
mfs16101 May 11, 2020
8ccfc65
Revert "Revert "Add more specifics to Config message comments""
mfs16101 May 11, 2020
361589d
Revert "Revert "Change arround data byte capture math""
mfs16101 May 11, 2020
63d094b
Revert "Revert "Revert "Change arround data byte capture math"""
mfs16101 May 11, 2020
0965acd
Revert changes with arithmetic
mfs16101 May 11, 2020
ea0e888
Merge branch 'dev' into fixAHRS
mfs16101 May 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -127,13 +127,13 @@ void AHRSInputIOProcessor::loop()

/* This gets the index of the bytes for the Euler angles in the captured
* buffer (szBuff). First, it finds the first byte of the message (i). Then,
* it finds the 7th index of the message (dataStart). This is where the first
* it finds the 14th index of the message (dataStart). This is where the last
* byte of the roll angle is. This allows me loop backward through each group
* of bytes, since the order needs to be reversed because the AHRS is in Big
* Endian.

* i is where the message starts in the buffer.
* dataStart = i + 7, which is where the data we want starts (for Roll).
* dataStart = i + 14, which is where the data we want starts (for Roll).
* To find Pitch and Yaw, we add 8 and 16 respectivly.
*
* MESSAGE STRUCTURE:
Expand All @@ -144,16 +144,16 @@ void AHRSInputIOProcessor::loop()
* | R1 R2 R3 R4 R5 R6 R7 R8 | P1 P2 P3 P4 P5 P6 P7 P8 | Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 |
* +-------------------------+-------------------------+-------------------------+
* ... | 7 8 9 10 11 12 13 14 | 15 16 17 18 19 20 21 22 | 23 24 25 26 27 28 29 30 | ...
* | ^ | ^ | ^ |
* |dataStart |dataStart + 8 |dataStart + 16 |
* | ^ | ^ | ^ |
* | dataStart| dataStart + 8| dataStart + 16|
* +-------------------------+-------------------------+-------------------------+
*/
int dataStart = -1;
for (int i=0; i < 32; i++)
{
if (szBuff[i] == 0xFA && szBuff[i+1] == 0xFF && szBuff[i+2] == 0x36)
{
dataStart = i + 7;
dataStart = i + 14;
break;
}
}
Expand All @@ -164,11 +164,11 @@ void AHRSInputIOProcessor::loop()
// Puts the bytes for each angle in their own array backwards, since they are sent in big endian
if (dataStart != -1)
{
for (int i = 7; i > -1; i--)
for (int i = 0; i < 8; i++)
{
rollArray[i] = szBuff[dataStart + i];
pitchArray[i] = szBuff[dataStart + i + 8];
yawArray[i] = szBuff[dataStart + i + 16];
rollArray[i] = szBuff[dataStart - i];
pitchArray[i] = szBuff[dataStart - i + 8];
yawArray[i] = szBuff[dataStart - i + 16];
}
}

Expand Down