From e2ea108b7b70deb8aa88b4c6dcdfd3edac5db2cf Mon Sep 17 00:00:00 2001 From: Matt Scalzo Date: Fri, 8 May 2020 16:28:49 -0400 Subject: [PATCH] Revert "Hmmm" This reverts commit 5a9cb089a1776d449f8ef04eec6f8d10589bbea5. --- .../io_procs/AHRSInputIOProcessor.cpp | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp b/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp index 6201ab1..91fae83 100644 --- a/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp +++ b/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp @@ -131,29 +131,17 @@ void AHRSInputIOProcessor::loop() } } - unsigned char rollArray[8]; - unsigned char pitchArray[8]; unsigned char yawArray[8]; if (index != -1) // This puts all those bytes { - for (int i = 0; i < 8; i++) - { - rollArray[i] = szBuff[index - (i + 8)]; - pitchArray[i] = szBuff[index - i]; - yawArray[i] = szBuff[index + (8 - i)]; - } + for (int i=0; i < 8; i++) + yawArray[i] = szBuff[index + (8-i)]; } - double doubleRoll = *reinterpret_cast(rollArray); - double doublePitch = *reinterpret_cast(pitchArray); double doubleYaw = *reinterpret_cast(yawArray); - Attribute attRoll("rolAngle", 8, &doubleRoll); - getComms()->sendAttribute(attRoll); - Attribute attPitch("pitAngle", 8, &doublePitch); - getComms()->sendAttribute(attPitch); - Attribute attYaw("yawAngle", 8, &doubleYaw); - getComms()->sendAttribute(attYaw); + Attribute attrib("yawAngle", 8, &doubleYaw); + getComms()->sendAttribute(attrib); // I am not sure if it will close autimatically when the process ends, at the moment I guess we just won't close it... //CloseHandle(hSerial); -} +} \ No newline at end of file