Class ExternalDeviceMotionFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Indicates the frame source of an external device with motion tracking capability. Usually refers to 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 that outputs motion data in ARSession.
You can inherit it to implement device input such as head-mounted displays, but you must complete the motion tracking function yourself. EasyAR's motion tracking cannot be directly used on external devices. You need to obtain image and pose data from hardware or other sources yourself and input them into EasyAR. EasyAR does not provide the ability to obtain these data, but provides the ability to run EasyAR functions after these data are input into EasyAR.
When using trial products (personal license, trial XR license, or trial Mega service, etc.) on custom cameras or head-mounted displays, EasyAR Sense will stop responding within 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)
Input 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 in any thread, as long as your APIs are thread-safe. These data need to be consistent with the data when the camera sensor is exposed. Whenever possible, it is recommended to input color data into EasyAR Sense, which is helpful for 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 into EasyAR Sense using the data pointer directly. Please note the 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 rendered frame data.
Please ensure that it is called per frame after the device data is ready, without skipping frames. These data need to be consistent with the data of the current Unity rendering camera in the same frame as the driver.
protected bool HandleRenderFrameData(double timestamp, Pose pose, MotionTrackingStatus trackingStatus)
Parameters
timestampposetrackingStatus