Class ExternalDeviceMotionFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Represents a frame source for external devices with motion tracking capability. Usually refers to head-mounted devices, where camera rendering and device tracking are handled by the device SDK.
This frame source is a motion tracking device that outputs motion data in ARSession.
You can implement device inputs like headsets by inheriting from it, but you must handle the motion tracking yourself; EasyAR's motion tracking cannot be used directly on external devices. You need to obtain image and pose data from hardware or other sources and input it to EasyAR; EasyAR does not provide the capability to acquire this data, but it does provide the ability to run EasyAR features after inputting this data.
When using trial products (such as Personal Edition license, Trial XR license, or Trial Mega service, etc.) on custom cameras or headsets, EasyAR Sense will stop responding after a fixed limited time upon each startup.
public abstract class ExternalDeviceMotionFrameSource : ExternalDeviceFrameSource
- Inheritance
-
ExternalDeviceMotionFrameSource
- Derived
- Inherited Members
Methods
HandleCameraFrameData(DeviceFrameSourceCamera, double, Image, CameraParameters, Pose, MotionTrackingStatus)
Input camera frame data.
It is recommended to input data at 30 or 60 fps. The minimum acceptable frame rate = 2, but some algorithm response times will be affected. It can be called from any thread, as long as your APIs are thread-safe. This data needs to match the data when the camera sensor is exposed. If available, it is recommended to input color data to EasyAR Sense, as this helps with the performance of EasyAR Mega. For optimal efficiency, you can design the entire data chain to pass the original YUV data directly through shared memory and input it directly to EasyAR Sense using a data pointer. Please note data ownership.
protected bool HandleCameraFrameData(DeviceFrameSourceCamera deviceCamera, double timestamp, Image image, CameraParameters cameraParameters, Pose deviceToOriginTransform, MotionTrackingStatus trackingStatus)
Parameters
deviceCameratimestampimagecameraParametersdeviceToOriginTransformtrackingStatus
Returns
HandleRenderFrameData(double, Pose, MotionTrackingStatus)
Input rendering frame data.
Make sure to call it every frame after the device data is ready; do not skip frames. This data needs to be consistent with the data driving the current Unity rendering camera within the same frame.
protected bool HandleRenderFrameData(double timestamp, Pose pose, MotionTrackingStatus trackingStatus)
Parameters
timestampposetrackingStatus