Forum Discussion

bitflave8's avatar
bitflave8
Honored Guest
2 months ago

How to use a custom QRCode tracking frequency in MRUK

In MRUK (MRUK.Trackers.cs) trackers are updated based on onTrackableUpdated events.

private void HandleTrackableUpdated(ref MRUKNativeFuncs.MrukTrackable trackable)
{
  if (_trackables.TryGetValue(trackable.space, out var component) && component)
  {
     UpdateTrackableProperties(component, ref trackable);
  }
}

Defined in MRUK.Shared.cs.

MRUKNativeFuncs.MrukEventListener listener;
// ...
listener.onTrackableUpdated = OnTrackableUpdated;
// ...
MRUKNativeFuncs.RegisterEventListener(listener);

Which seem to be triggered by native code.

RegisterEventListener = MRUKNative.LoadFunction<RegisterEventListenerDelegate>("RegisterEventListener");

Is there any way to edit such code in order to increase the frequency at wich onTrackableUpdated  is fired?

Will MRUK enable setting tracker update frequency in the future?

1 Reply

  • Hello,

    That’s a great question. I’m happy to help!

    Have you measured how often the function is triggered per second? I’d recommend testing this in a completely empty project, using only the QR code tracker.

    Do you have a specific update frequency that your use case requires? Once you know that, it’ll be easier to decide how deeply you need to optimize or investigate further.

    These are important first steps, as they’ll give you a clear picture of the current behavior and your target performance.

    It’s also worth noting that, independent of the QR code tracking component, there’s an inherent limitation from the camera itself. Since the camera captures at around 30 Hz, you can theoretically get up to 30 image updates per second. In practice, it’s usually closer to 27–28 images, based on my experience. On heavy workload even less.

    Let me know what you find out, we can continue investigating this together!

    If this answers your question, please mark it as solved.

    ~ Nigel (XR Bootcamp)

     

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions