Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
davidwyandgg's avatar
davidwyandgg
Explorer
12 years ago

Using SensorFusion Prediction

Hey Rift Peeps.

I'm interested in making use of the C++ SDK's SensorFusion prediction feature and I had a couple of questions:

1. What are the units for the SensorFusion::SetPrediction()'s dt parameter? Is it in seconds, or ms? I thought of using SensorFusion::GetPredictionDelta() to determine this, but by default it returns a value of 0, so I couldn't guess on the units.

2. I assume that I should be using SensorFusion::GetPredictedOrientation() rather than SensorFusion::GetOrientation() when I want to use the predicted value?

None of the C++ examples make use of SensorFusion prediction so I didn't have anything to reference. I see that the Unity demo does allow you to adjust the prediction amount, so that may be something to add as an option to the C++ demos too, just for an example of usage.

Thanks!

- Dave

4 Replies

  • mikeant's avatar
    mikeant
    Honored Guest
    The prediction value is in seconds; a value such as 0.04f can help the experience - it's good to keep it a bit lower then overall latency though. You'll indeed need to call GetPredictedOrientation() to get the result. Sorry for lack of information here; we''ll update the comments and will plan to add it to the sample.

    Thank you,
    Michael
  • Thanks for the info, Michael. I can now move forward with adding sensor prediction to Torque 3D.

    - Dave
  • sth's avatar
    sth
    Honored Guest
    Just a quick note:
    As of v0.2.3 of the SDK, the documentation still doesn't mention any of this (you only find it by studying the demo applications). Given the dramatic impact motion prediction has on perceived latency, it would be great if this could be added to the documentation.
  • I wouldn't have known about this if you hadn't resurrected this thread sth, thanks! You're right, this is not very well documented.