Context:
- I have an Arduino Nano RP2040 Connect device which has a built-in IMU.
- I also have written an iOS app that utilizes SceneKit and can render/animate SCNNodes.
Goal
I want to move my Arduino around in real life and have a visualizer in SceneKit mirror those movements in virtual space.
So far, I can
- access Arduino's IMU accelerometer and gyroscope values from the Arduino and pass them to my iOS app in real time.
- render an SCNNode and animate updates to the position and rotation arbitrarily
What's missing
- I need to write the logic to convert the accelerometer and gyroscope vectors into position and rotation vectors.
I've attempted a couple different suggestions on how to do this, but the result is never correct. Can someone please help me with the code to make that work?
side note - I understand my Arduino and SceneKit coordinates work off of different axis, but the visualization I result in is not at all close to mirroring the Arduino so I feel I'm pretty far off the mark here so far.