- Home /
Reversed axes with quaternions and orientation sensor
Been dealing with kind of a weird problem...At first I thought I had made a mistake in my code as it went away for about a week, but now it's returned with a vengeance. As a bit of background, I'm trying to use a 9-DOF sensor (BNO055) mounted to a real-world object in order to give the orientation of that same object in my game. I'm using Arduino code to stream the data over UDP (I'm using a Feather M0 WINC1500 controller), and Unity is receiving the data and feeding the quaternion to the object in my game.
Everything is fine until I start up my program and the axes randomly reverse direction...Sometimes it's one, two, or all three axes. And it might stay consistent for a couple hours or days. And then the axes flip again. I haven't changed anything in my code, so I'm pretty certain this is a hardware issue. But I don't understand it because I've never heard of this issue before.
My coworker said it might be because of a change in the surrounding electrical field that would cause the chip to read differently. If anybody here is familiar with this problem, I would really appreciate the help. Thank you. Included below is the code I'm using to orientate the object...I had to change the order of x,y,z in order to match up the axes to the object in Unity...:
transform.rotation = new Quaternion(float.Parse(BNO055[2]),float.Parse(BNO055[3]),float.Parse(BNO055[1]),float.Parse(BNO055[0]));
Vector3 finalRotation = transform.eulerAngles - offset;
transform.rotation = Quaternion.Euler(finalRotation);
Could you provide some insight on how to get the assembly to work. I am using the same board and sensor but could not get the board to detect I$$anonymous$$U sensor. Did you use adafruit bno055 library? Any help would be highly appreciated.
Thanks,
Hi, I'm trying the exact same setup right now with same results. How did you resolve the issue?
Your answer
Follow this Question
Related Questions
Is there any examples of published unity app or games that interact with hardwares? 0 Answers
Quaternions applied to Sensor Fusion: gyro.attitude with compass 1 Answer
Arduino Temperature Sensor Read Values in Unity 5 Answers
Simple Rotation 1 Answer
i have rotated an gameobject but the axis of the object did not change 2 Answers