Class ExternalDeviceMotionFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
A frame source representing an external device with motion tracking capability. It usually represents a head-mounted device, where camera rendering and device tracking are both completed by the device SDK.
This frame source is a motion tracking device and outputs motion data in ARSession.
You can inherit from it to implement device input such as a headset, but you must implement motion tracking yourself. EasyAR motion tracking cannot be used directly on external devices. You need to obtain image and pose data yourself from hardware or elsewhere and input them to EasyAR. EasyAR does not provide the ability to acquire this data, but does provide the ability to run EasyAR features after the data is input to EasyAR.
When trial products, such as a personal license, trial XR license, or trial Mega service, are used on a custom camera or headset, EasyAR Sense will stop responding for a fixed limited time after each startup.
public abstract class ExternalDeviceMotionFrameSource : ExternalDeviceFrameSource
- Inheritance
-
ExternalDeviceMotionFrameSource
- Derived
- Inherited Members
Methods
HandleCameraFrameData(DeviceFrameSourceCamera, double, Image, CameraParameters, Pose, MotionTrackingStatus)
Inputs camera frame data.
It is recommended to input data at 30 or 60 fps. The minimum acceptable frame rate is 2, but the response time of some algorithms will be affected. It can be called from any thread as long as your APIs are thread-safe. This data must be consistent with the data at the time of camera sensor exposure. Whenever available, it is recommended to input color data to EasyAR Sense, which helps the effect of EasyAR Mega. For best efficiency, you can design the entire data chain so that raw YUV data passes directly through shared memory and is passed to EasyAR Sense directly with a data pointer. Pay attention to data ownership.
protected bool HandleCameraFrameData(DeviceFrameSourceCamera deviceCamera, double timestamp, Image image, CameraParameters cameraParameters, Pose deviceToOriginTransform, MotionTrackingStatus trackingStatus)
Parameters
deviceCameratimestampimagecameraParametersdeviceToOriginTransformtrackingStatus
HandleRenderFrameData(double, Pose, MotionTrackingStatus)
Inputs rendering frame data.
Make sure to call it every frame after device data is ready. Frames cannot be skipped. This data must be consistent with the data of the current Unity rendering camera in the same frame driven by the device.
protected bool HandleRenderFrameData(double timestamp, Pose pose, MotionTrackingStatus trackingStatus)
Parameters
timestampposetrackingStatus