I am trying to achieve a mouse pointer like movement with the IMU. In other words, if one moves the sensor to the right, the point would move to the right, if move to the left, then to left, etc.
I am able to get and parse the data from the device, but from that point, I am not sure how to proceed. I tried using the MadgwickAHRS algorithm, but after that only the orientation of the object works. https://github.com/xioTechnologies/Open … ickAHRS.cs
How can I make the object move based on the quaternion or is there another way?
Hey TS-Russell , thank you for your quick response. I am still quite new to all of this. Maybe I should have elaborated more on what I am trying to achieve.
I would like to make the movement in another application, where I can have more control of it and it’s behavior. I am using Unity3D. So ideally, the IMU should send the data to a unity application, where I can parse it and do the movement. And also this should be completely wireless.
I tried something else - I took the example in the sketches IMU_DMP_Quat6 and sent the roll, pitch and yaw to may application. I looked at some code from here: https://www.hackster.io/movsensllc/diy- … cro-548353
From there I used this code:
vertValue = yaw - vertZero;
horzValue = roll - horzZero;
vertZero = yaw;
horzZero = roll;
if (vertValue != 0)
transform.position = new Vector3(0, vertValue * sensitivity, 0); // move mouse on y axis
if (horzValue != 0)
transform.position = new Vector3(horzValue * sensitivity, 0, 0); // move mouse on x axis
The object moves on the screen, so far so good. However, my object doesn’t move correctly. Does someone here know what could be wrong? I am also not sure what is the correct way to hold the device.