Table of Contents

Class MegaGoTracker

Espaço de nomes
easyar

Fornece device-side localization. MegaGoTracker occupies 2 camera buffers.

MegaGoTracker

Métodos

isAvailable

Verifica whether the component is available. On Android, API Level 24 or higher is required; all platforms must satisfy the required runtime dependencies.

bool easyar_MegaGoTracker_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
+ (bool)isAvailable
public static func isAvailable() -> Bool
public static bool isAvailable()

Retorna

Tipo Descrição
Boolean

inputFrameSink

Input frame input port. Input frames must contain image, camera parameters, and timestamp. 6DoF spatial information must contain cameraTransform and trackingStatus. Refer to InputFrameSink.

void easyar_MegaGoTracker_inputFrameSink(easyar_MegaGoTracker * This, easyar_InputFrameSink * * Return)
std::shared_ptr<InputFrameSink> inputFrameSink()
public @Nonnull InputFrameSink inputFrameSink()
fun inputFrameSink(): InputFrameSink
- (easyar_InputFrameSink *)inputFrameSink
public func inputFrameSink() -> InputFrameSink
public virtual InputFrameSink inputFrameSink()

Retorna

Tipo Descrição
InputFrameSink

accelerometerResultSink

Accelerometer result input port. Refer to AccelerometerResultSink.

void easyar_MegaGoTracker_accelerometerResultSink(easyar_MegaGoTracker * This, easyar_AccelerometerResultSink * * Return)
std::shared_ptr<AccelerometerResultSink> accelerometerResultSink()
public @Nonnull AccelerometerResultSink accelerometerResultSink()
fun accelerometerResultSink(): AccelerometerResultSink
- (easyar_AccelerometerResultSink *)accelerometerResultSink
public func accelerometerResultSink() -> AccelerometerResultSink
public virtual AccelerometerResultSink accelerometerResultSink()

Retorna

Tipo Descrição
AccelerometerResultSink

bufferRequirement

The number of camera buffers occupied by the current component.

int easyar_MegaGoTracker_bufferRequirement(const easyar_MegaGoTracker * This)
int bufferRequirement()
public int bufferRequirement()
fun bufferRequirement(): Int
- (int)bufferRequirement
public func bufferRequirement() -> Int32
public virtual int bufferRequirement()

Retorna

Tipo Descrição
Int32

outputFrameSource

Output frame output port. Refer to OutputFrameSource.

void easyar_MegaGoTracker_outputFrameSource(easyar_MegaGoTracker * This, easyar_OutputFrameSource * * Return)
std::shared_ptr<OutputFrameSource> outputFrameSource()
public @Nonnull OutputFrameSource outputFrameSource()
fun outputFrameSource(): OutputFrameSource
- (easyar_OutputFrameSource *)outputFrameSource
public func outputFrameSource() -> OutputFrameSource
public virtual OutputFrameSource outputFrameSource()

Retorna

Tipo Descrição
OutputFrameSource

create

Cria an instance.

void easyar_MegaGoTracker_create(easyar_MegaGoTracker * * Return)
static std::shared_ptr<MegaGoTracker> create()
public static @Nonnull MegaGoTracker create()
companion object fun create(): MegaGoTracker
+ (easyar_MegaGoTracker *)create
public static func create() throws -> MegaGoTracker
public static MegaGoTracker create()

Retorna

Tipo Descrição
MegaGoTracker

extractBlockInfoFromFile

Extrai block information from a map file.

void easyar_MegaGoTracker_extractBlockInfoFromFile(easyar_String * path, easyar_OptionalOfMegaGoBlockInfo * Return)
static std::optional<std::shared_ptr<MegaGoBlockInfo>> extractBlockInfoFromFile(std::string path)
public static @Nullable MegaGoBlockInfo extractBlockInfoFromFile(java.lang.@Nonnull String path)
companion object fun extractBlockInfoFromFile(path: String): MegaGoBlockInfo?
+ (easyar_MegaGoBlockInfo *)extractBlockInfoFromFile:(NSString *)path
public static func extractBlockInfoFromFile(_ path: String) -> MegaGoBlockInfo?
public static Optional<MegaGoBlockInfo> extractBlockInfoFromFile(string path)

Parâmetros

Nome Tipo Descrição
path String

Retorna

Tipo Descrição
Optional<MegaGoBlockInfo>

extractBlockInfoFromBuffer

Extrai block information from map memory data.

void easyar_MegaGoTracker_extractBlockInfoFromBuffer(easyar_Buffer * buffer, easyar_OptionalOfMegaGoBlockInfo * Return)
static std::optional<std::shared_ptr<MegaGoBlockInfo>> extractBlockInfoFromBuffer(std::shared_ptr<Buffer> buffer)
public static @Nullable MegaGoBlockInfo extractBlockInfoFromBuffer(@Nonnull Buffer buffer)
companion object fun extractBlockInfoFromBuffer(buffer: Buffer): MegaGoBlockInfo?
+ (easyar_MegaGoBlockInfo *)extractBlockInfoFromBuffer:(easyar_Buffer *)buffer
public static func extractBlockInfoFromBuffer(_ buffer: Buffer) -> MegaGoBlockInfo?
public static Optional<MegaGoBlockInfo> extractBlockInfoFromBuffer(Buffer buffer)

Parâmetros

Nome Tipo Descrição
buffer Buffer

Retorna

Tipo Descrição
Optional<MegaGoBlockInfo>

setEnableStatelessLocalization

Define whether stateless localization is enabled. When stateless localization is enabled, the previous localization result is not used during localization. The default is false.

void easyar_MegaGoTracker_setEnableStatelessLocalization(easyar_MegaGoTracker * This, bool enableStatelessLocalization)
void setEnableStatelessLocalization(bool enableStatelessLocalization)
public void setEnableStatelessLocalization(boolean enableStatelessLocalization)
fun setEnableStatelessLocalization(enableStatelessLocalization: Boolean): Unit
- (void)setEnableStatelessLocalization:(bool)enableStatelessLocalization
public func setEnableStatelessLocalization(_ enableStatelessLocalization: Bool) -> Void
public virtual void setEnableStatelessLocalization(bool enableStatelessLocalization)

Parâmetros

Nome Tipo Descrição
enableStatelessLocalization Boolean

Retorna

Tipo Descrição
Void

setResultAsyncMode

Define result async mode. If results are output through outputFrameSource, it should be set to true; if results are obtained through getSyncResult, it should be set to false. The default value is true. Sync mode is available only when using an XR License. Retorna true when the requested mode is successfully applied; returns false when sync mode is not supported and keeps async mode.

bool easyar_MegaGoTracker_setResultAsyncMode(easyar_MegaGoTracker * This, bool enableAsync)
bool setResultAsyncMode(bool enableAsync)
public boolean setResultAsyncMode(boolean enableAsync)
fun setResultAsyncMode(enableAsync: Boolean): Boolean
- (bool)setResultAsyncMode:(bool)enableAsync
public func setResultAsyncMode(_ enableAsync: Bool) -> Bool
public virtual bool setResultAsyncMode(bool enableAsync)

Parâmetros

Nome Tipo Descrição
enableAsync Boolean

Retorna

Tipo Descrição
Boolean

status

Retorna the current running status of MegaGoTracker.

easyar_MegaGoTrackerStatus easyar_MegaGoTracker_status(const easyar_MegaGoTracker * This)
MegaGoTrackerStatus status()
public int status()
fun status(): Int
- (easyar_MegaGoTrackerStatus)status
public func status() -> MegaGoTrackerStatus
public virtual MegaGoTrackerStatus status()

Retorna

Tipo Descrição
MegaGoTrackerStatus

error

Retorna the current error of MegaGoTracker. Empty when there is no error.

easyar_OptionalOfMegaGoTrackerError easyar_MegaGoTracker_error(const easyar_MegaGoTracker * This)
std::optional<MegaGoTrackerError> error()
public @Nullable Integer error()
fun error(): Int?
- (NSNumber *)error
public func error() -> MegaGoTrackerError?
public virtual Optional<MegaGoTrackerError> error()

Retorna

Tipo Descrição
Optional<MegaGoTrackerError>

setLocalizationCallback

Define the localization callback. When the running status is Detecting or Tracking, each valid and uncanceled localization response reports whether it updated the output and the timestamp of the corresponding input frame.

void easyar_MegaGoTracker_setLocalizationCallback(easyar_MegaGoTracker * This, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromMegaGoTrackerLocalizationResponse callback)
void setLocalizationCallback(std::shared_ptr<CallbackScheduler> callbackScheduler, std::function<void(std::shared_ptr<MegaGoTrackerLocalizationResponse>)> callback)
public void setLocalizationCallback(@Nonnull CallbackScheduler callbackScheduler, @Nonnull FunctorOfVoidFromMegaGoTrackerLocalizationResponse callback)
fun setLocalizationCallback(callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromMegaGoTrackerLocalizationResponse): Unit
- (void)setLocalizationCallback:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_MegaGoTrackerLocalizationResponse * response))callback
public func setLocalizationCallback(_ callbackScheduler: CallbackScheduler, _ callback: @escaping (MegaGoTrackerLocalizationResponse) -> Void) -> Void
public virtual void setLocalizationCallback(CallbackScheduler callbackScheduler, Action<MegaGoTrackerLocalizationResponse> callback)

Parâmetros

Nome Tipo Descrição
callbackScheduler CallbackScheduler
callback Action<MegaGoTrackerLocalizationResponse>

Retorna

Tipo Descrição
Void

setCameraPositionOverride

Define the override value of the camera position relative to the map block. After it is set, MegaGoTracker outputs the override value instead of using the corresponding coordinates in input frame data. This can be used to improve output pose accuracy when map information is known and sensors are limited.

void easyar_MegaGoTracker_setCameraPositionOverride(easyar_MegaGoTracker * This, easyar_OptionalOfFloat x, easyar_OptionalOfFloat y, easyar_OptionalOfFloat z)
void setCameraPositionOverride(std::optional<float> x, std::optional<float> y, std::optional<float> z)
public void setCameraPositionOverride(java.lang.@Nullable Float x, java.lang.@Nullable Float y, java.lang.@Nullable Float z)
fun setCameraPositionOverride(x: Float?, y: Float?, z: Float?): Unit
- (void)setCameraPositionOverride:(NSNumber *)x y:(NSNumber *)y z:(NSNumber *)z
public func setCameraPositionOverride(_ x: Float?, _ y: Float?, _ z: Float?) -> Void
public virtual void setCameraPositionOverride(Optional<float> x, Optional<float> y, Optional<float> z)

Parâmetros

Nome Tipo Descrição
x Optional<Single>
y Optional<Single>
z Optional<Single>

Retorna

Tipo Descrição
Void

loadTargetFromFile

Carrega asynchronously a target from a file. A target can be used for localization only after it is successfully loaded. Only one target can be active at a time. Calling this method immediately clears the block instance currently localized by Tracker and the accumulated tracking state. If this load fails or is canceled, the previous target and localization instance will not be restored. Calling this method replaces any unfinished load request. An ongoing load may not stop immediately; the callback of the replaced request will be called after the operation ends, with result status MegaGoTargetLoadStatus.Canceled. When the target cannot be parsed or its content is damaged, the result status is MegaGoTargetLoadStatus.InvalidTarget. This method returns immediately. After loading completes, callback is called on the thread specified by CallbackScheduler; on success, the result contains the loaded block information. MegaGoTargetLoadStatus.Success only means target data was loaded successfully. Subsequent validation may still continue or fail. Check the current processing status and error of MegaGoTracker through status and error. Pending callbacks will no longer be called after MegaGoTracker is closed.

void easyar_MegaGoTracker_loadTargetFromFile(easyar_MegaGoTracker * This, easyar_String * path, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromMegaGoTargetLoadResult callback)
void loadTargetFromFile(std::string path, std::shared_ptr<CallbackScheduler> callbackScheduler, std::function<void(std::shared_ptr<MegaGoTargetLoadResult>)> callback)
public void loadTargetFromFile(java.lang.@Nonnull String path, @Nonnull CallbackScheduler callbackScheduler, @Nonnull FunctorOfVoidFromMegaGoTargetLoadResult callback)
fun loadTargetFromFile(path: String, callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromMegaGoTargetLoadResult): Unit
- (void)loadTargetFromFile:(NSString *)path callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_MegaGoTargetLoadResult * result))callback
public func loadTargetFromFile(_ path: String, _ callbackScheduler: CallbackScheduler, _ callback: @escaping (MegaGoTargetLoadResult) -> Void) -> Void
public virtual void loadTargetFromFile(string path, CallbackScheduler callbackScheduler, Action<MegaGoTargetLoadResult> callback)

Parâmetros

Nome Tipo Descrição
path String
callbackScheduler CallbackScheduler
callback Action<MegaGoTargetLoadResult>

Retorna

Tipo Descrição
Void

loadTargetFromBuffer

Carrega asynchronously a target from memory. A target can be used for localization only after it is successfully loaded. Only one target can be active at a time. Calling this method immediately clears the block instance currently localized by Tracker and the accumulated tracking state. If this load fails or is canceled, the previous target and localization instance will not be restored. Calling this method replaces any unfinished load request. An ongoing load may not stop immediately; the callback of the replaced request will be called after the operation ends, with result status MegaGoTargetLoadStatus.Canceled. When the target cannot be parsed or its content is damaged, the result status is MegaGoTargetLoadStatus.InvalidTarget. This method returns immediately. After loading completes, callback is called on the thread specified by CallbackScheduler; on success, the result contains the loaded block information. MegaGoTargetLoadStatus.Success only means target data was loaded successfully. Subsequent validation may still continue or fail. Check the current processing status and error of MegaGoTracker through status and error. Pending callbacks will no longer be called after MegaGoTracker is closed.

void easyar_MegaGoTracker_loadTargetFromBuffer(easyar_MegaGoTracker * This, easyar_Buffer * buffer, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromMegaGoTargetLoadResult callback)
void loadTargetFromBuffer(std::shared_ptr<Buffer> buffer, std::shared_ptr<CallbackScheduler> callbackScheduler, std::function<void(std::shared_ptr<MegaGoTargetLoadResult>)> callback)
public void loadTargetFromBuffer(@Nonnull Buffer buffer, @Nonnull CallbackScheduler callbackScheduler, @Nonnull FunctorOfVoidFromMegaGoTargetLoadResult callback)
fun loadTargetFromBuffer(buffer: Buffer, callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromMegaGoTargetLoadResult): Unit
- (void)loadTargetFromBuffer:(easyar_Buffer *)buffer callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_MegaGoTargetLoadResult * result))callback
public func loadTargetFromBuffer(_ buffer: Buffer, _ callbackScheduler: CallbackScheduler, _ callback: @escaping (MegaGoTargetLoadResult) -> Void) -> Void
public virtual void loadTargetFromBuffer(Buffer buffer, CallbackScheduler callbackScheduler, Action<MegaGoTargetLoadResult> callback)

Parâmetros

Nome Tipo Descrição
buffer Buffer
callbackScheduler CallbackScheduler
callback Action<MegaGoTargetLoadResult>

Retorna

Tipo Descrição
Void

unloadTarget

Descarrega the current target and clears the current localization instance and accumulated tracking state. The logical state of the target immediately becomes unloaded. Calling this method also replaces all unfinished load requests. An ongoing load may not stop immediately; the callback of the replaced request will be called after the operation ends, with result status MegaGoTargetLoadStatus.Canceled. This method has no callback and does not wait for the unload operation to complete. If there is no loaded or loading target, calling this method has no additional effect.

void easyar_MegaGoTracker_unloadTarget(easyar_MegaGoTracker * This)
void unloadTarget()
public void unloadTarget()
fun unloadTarget(): Unit
- (void)unloadTarget
public func unloadTarget() -> Void
public virtual void unloadTarget()

Retorna

Tipo Descrição
Void

start

Inicia processing input frames and outputting results. Retorna true when the call succeeds; returns false when MegaGoTracker is closed. Repeated calls have no additional effect. Calling this method after stop continues using the loaded target without reloading.

bool easyar_MegaGoTracker_start(easyar_MegaGoTracker * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()

Retorna

Tipo Descrição
Boolean

stop

Para processing input frames and clears the currently localized block instance and accumulated tracking state. Unfinished processing results will be discarded. The loaded target is not unloaded, and unfinished target loading is not canceled; its callback will still be called. At this time, the running status is Idle. Call start to continue using the loaded target.

void easyar_MegaGoTracker_stop(easyar_MegaGoTracker * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()

Retorna

Tipo Descrição
Void

close

Fecha permanently MegaGoTracker, stops processing input frames, clears the currently localized block instance and accumulated tracking state, unloads the target, and releases related resources. Repeated calls have no additional effect. All unfinished localization and target loading operations are canceled, and pending callbacks will no longer be called. This method may wait until ongoing operations finish before returning. MegaGoTracker should not be used after close; calling start will return false.

void easyar_MegaGoTracker_close(easyar_MegaGoTracker * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

Retorna

Tipo Descrição
Void

getSyncResult

Obtem the synchronous output result. motionInputData must be non-empty, and sync mode must be enabled through setResultAsyncMode. When MegaGoTracker is paused, closed, in an error state, or currently cannot generate a sync result, the return value is empty.

void easyar_MegaGoTracker_getSyncResult(easyar_MegaGoTracker * This, easyar_MotionInputData * motionInputData, easyar_OptionalOfMegaGoTrackerResult * Return)
std::optional<std::shared_ptr<MegaGoTrackerResult>> getSyncResult(std::shared_ptr<MotionInputData> motionInputData)
public @Nullable MegaGoTrackerResult getSyncResult(@Nonnull MotionInputData motionInputData)
fun getSyncResult(motionInputData: MotionInputData): MegaGoTrackerResult?
- (easyar_MegaGoTrackerResult *)getSyncResult:(easyar_MotionInputData *)motionInputData
public func getSyncResult(_ motionInputData: MotionInputData) -> MegaGoTrackerResult?
public virtual Optional<MegaGoTrackerResult> getSyncResult(MotionInputData motionInputData)

Parâmetros

Nome Tipo Descrição
motionInputData MotionInputData

Retorna

Tipo Descrição
Optional<MegaGoTrackerResult>