Use separate gameobject in Unity for position and rotation

Is it possible to use an object that isn’t the ZED IMU for position and rotation in a Unity project? We’re going to be attaching the ZED Mini to a piece of hardware with its own IMU that isn’t a VR headset.

I have tried the following settings:

  • Moving the object with the ZEDManager script under the new tracked object
  • Disabling Tracking
  • Disabling Spatial Memory
  • Enabling Static Tracking

The in-game camera was moving with the parent object, but wasn’t rotating. And the spatial mesh wasn’t being created.

Any help would be appreciated.

Hi,

Thanks for reaching us out.

You can give external IMU information to the ZED SDK with the “SetIMUPior” function (here is the link to the c++ documentation). It is what we use to give the Headset rotation data to the SDK.

Note that it does not replace the Camera IMU but is used to assist the tracking of the camera.

Best,
Benjamin Vallon

Stereolabs Support

Thanks Benjamin!

The link came through in your email, but not the forum post. I’ll include it here for anyone that might need it.

https://www.stereolabs.com/docs/api/classsl_1_1Camera.html#a068401461f6b75d7a8e032a51170a97a

1 Like

Let me know if I understand this correctly, if you would:

Moving the Gameobject with the ZEDManager script to be parented by another moving object is sufficient to update the camera’s position for purposes of spatial mapping, as long as “Tracking is Static” is checked.

But the rotation of the camera must be supplied manually using the ZEDManager.zedCamera.SetIMUOrientationPrior function.

Moving the Gameobject with the ZEDManager script to be parented by another moving object is sufficient to update the camera’s position for purposes of spatial mapping, as long as “Tracking is Static” is checked.

Unfortunately no. You would need to send the tracking data to the SDK, which is not possible for the moment. You can only ingest an IMU prior (only orientation, mostly used for AR apps) with the current SDK

However, being able to use external tracking data inside the SDK is an interesting feature. I’ll share that with the team and we’ll discuss how it can be added to the SDK.

If you have any suggestion/specific needs about that, do not hesitate to share that with us. You can contact us at support@stereolabs.com if you want to tell us more about your project.

Best,
Benjamin Vallon

Stereolabs Support