I’m finding difficult to minimise drift without having to recalibrate constantly. Example: X axis effects the wraparound values for the Y and z axis. so after moving in a circular motion then returning to calibrated position the axis do not return 0’s and have drifted is this a bug or is there a way in blueprint to fix or compensate for this ? i am trying to achieve independent of pitch, yaw and roll to control the turn rates of a space craft. . i have tried all my brain can handle with this and would really appreciate some advice please.
thanks
It’s not possible, AFAIK. Gyroscopes will drift, it’s unavoidable. You cannot get a reliable global direction from them. You’d need to use the camera in some way to track external reference landmarks to correct the drift. It should also be possible to use the compass to help with yaw drifting.
thanks , i understand there will always be some drift / inaccuracy but after one circular movement the pitch and yaw can be out by as much as 10-15 degrees (using the blueprint nodes get motion input).
I’ve found a file in me projects IOSInputInterface.cpp which from what i can tell gets pitch roll and yaw from CMAttitude and after much google reading up I’m led to believe that more accurate results can be obtained using a quaternion from Attitude wit a bit of math to calculate pitch yaw and roll from axis x,y,z and w.
I’ve been trying but I’m not competent with code and don’t know how to implement this correctly to get these input values into my Blueprint projects.
again any advice is very much appreciated.
Thanks,
I’ve checked your game and have been doing some tests and you shouldn’t be getting that much drift. The whole calculation is done by the iOS SDK, UE4 just forwards the numbers to blueprint.
How are you reading input in your blueprints and applying the values for movement? I tested using the “Tilt” key input, which contains the Attitude’s yaw, roll and pitch in radians. At worst got a little under 2 degrees of drift on roll. For your game you should read the tilt Y (roll) and Z (pitch) and perform a deadzone check (ignore absolute values below ~2 degrees) before using them to move the ship.
thanks for your time , ill be so happy if I’m doing it all wrong and it can be fixed.