MaxstAR Native Android  5.0.2
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes
com.maxst.ar.TrackerManager Class Reference

Description

TrackerManager class controls trackers provided by MAXST AR.

Public Member Functions

void startTracker (int trackerType)
 Start a AR tracker. More...
 
void setCloudRecognitionSecretIdAndKey (String secretId, String secretKey)
 Set secret ID and key for access of cloud recognition. More...
 
void stopTracker ()
 Stop a tracker. More...
 
void destroyTracker ()
 Destroy a tracker. Remove all tracking data including map data and tracking results. More...
 
void addTrackerData (String trackingFileName, boolean isAndroidAssetFile)
 Add a map file to the candidate list for Image Tracker, Object Tracker, Image Fusion Tracker and Object Fusion Tracker. More...
 
void loadTrackerData ()
 Load the map files in the candidate list to a memory. This method runs asynchrously to the main (UI) thread. More...
 
boolean isTrackerDataLoadCompleted ()
 Get a boolean value representing whether loading the map files is complete. More...
 
boolean isFusionSupported ()
 Get a boolean value representing whether the current device supports AR fusion trackers. More...
 
int getFusionTrackingState ()
 Get the status of the AR fusion tracker working on the current app. More...
 
TrackingState updateTrackingState ()
 Update and get the current tracking state. More...
 
void findSurface ()
 Start to find the groud plane visible through the camera. It works only on Instant Tracker. More...
 
void quitFindingSurface ()
 Stop to find the ground plane. It works only on Instant Tracker. More...
 
void setTrackingOption (TrackingOption option)
 Set tracking options for AR Trackers. More...
 
void getWorldPositionFromScreenCoordinate (float[] screenCoord, float[] worldPos)
 Get 3d world position corresponding to given 2d screen position. More...
 
GuideInfo getGuideInformation ()
 Get the guide information such as feature points, a bounding box and anchors concerning Object Tracker. More...
 

Static Public Member Functions

static TrackerManager getInstance ()
 Get the singleton instance of TrackerManager. More...
 
static String requestARCoreApk (Activity activity)
 Get a message with respect to preparation of ARCore in the current app. More...
 

Static Public Attributes

static final int TRACKER_TYPE_CODE_SCANNER = 0X01
 
static final int TRACKER_TYPE_IMAGE = 0X02
 
static final int TRACKER_TYPE_MARKER = 0X04
 
static final int TRACKER_TYPE_OBJECT = 0X08
 
static final int TRACKER_TYPE_INSTANT = 0x20
 
static final int TRACKER_TYPE_QR_TRACKER = 0x40
 
static final int TRACKER_TYPE_CLOUD_RECOGNIZER = 0x30
 
static final int TRACKER_TYPE_IMAGE_FUSION = 0x80
 
static final int TRACKER_TYPE_OBJECT_FUSION = 0x100
 
static final int TRACKER_TYPE_QR_FUSION = 0x400
 
static final int TRACKER_TYPE_MARKER_FUSION = 0x800
 
static final int TRACKER_TYPE_INSTANT_FUSION = 0x10000
 

Member Function Documentation

◆ addTrackerData()

void com.maxst.ar.TrackerManager.addTrackerData ( String  trackingFileName,
boolean  isAndroidAssetFile 
)

Add a map file to the candidate list for Image Tracker, Object Tracker, Image Fusion Tracker and Object Fusion Tracker.

After adding some map files, loadTrackerData should be called.

Parameters
trackingFileNameabsolute file path if the map file is located in sdcard, or a relative file name path if the map file is located in assets folder.
isAndroidAssetFileflag to notify whether the map file is located in assets folder.

◆ destroyTracker()

void com.maxst.ar.TrackerManager.destroyTracker ( )

Destroy a tracker. Remove all tracking data including map data and tracking results.

◆ findSurface()

void com.maxst.ar.TrackerManager.findSurface ( )

Start to find the groud plane visible through the camera. It works only on Instant Tracker.

◆ getFusionTrackingState()

int com.maxst.ar.TrackerManager.getFusionTrackingState ( )

Get the status of the AR fusion tracker working on the current app.

Returns
1 if the tracking status is successful, otherwise -1.

◆ getGuideInformation()

GuideInfo com.maxst.ar.TrackerManager.getGuideInformation ( )

Get the guide information such as feature points, a bounding box and anchors concerning Object Tracker.

It works only on Object Tracker.

Returns
GuideInfo instance

◆ getInstance()

static TrackerManager com.maxst.ar.TrackerManager.getInstance ( )
static

Get the singleton instance of TrackerManager.

Returns
the singleton instance of TrackerManager

◆ getWorldPositionFromScreenCoordinate()

void com.maxst.ar.TrackerManager.getWorldPositionFromScreenCoordinate ( float[]  screenCoord,
float[]  worldPos 
)

Get 3d world position corresponding to given 2d screen position.

Parameters
xand y in screen coordinate as an input.
x,yand z in world coordinate as an output.

◆ isFusionSupported()

boolean com.maxst.ar.TrackerManager.isFusionSupported ( )

Get a boolean value representing whether the current device supports AR fusion trackers.

Returns
true if the device supports AR fusion trackers.

◆ isTrackerDataLoadCompleted()

boolean com.maxst.ar.TrackerManager.isTrackerDataLoadCompleted ( )

Get a boolean value representing whether loading the map files is complete.

Returns
true if loading the map files is complete.

◆ loadTrackerData()

void com.maxst.ar.TrackerManager.loadTrackerData ( )

Load the map files in the candidate list to a memory. This method runs asynchrously to the main (UI) thread.

◆ quitFindingSurface()

void com.maxst.ar.TrackerManager.quitFindingSurface ( )

Stop to find the ground plane. It works only on Instant Tracker.

◆ requestARCoreApk()

static String com.maxst.ar.TrackerManager.requestARCoreApk ( Activity  activity)
static

Get a message with respect to preparation of ARCore in the current app.

Returns
true if the device supports AR fusion trackers.

◆ setCloudRecognitionSecretIdAndKey()

void com.maxst.ar.TrackerManager.setCloudRecognitionSecretIdAndKey ( String  secretId,
String  secretKey 
)

Set secret ID and key for access of cloud recognition.

The secret Id and key can be obtained through https://developer.maxst.com.

Parameters
secretIdsecret ID
secretKeysecret key

◆ setTrackingOption()

void com.maxst.ar.TrackerManager.setTrackingOption ( TrackingOption  option)

Set tracking options for AR Trackers.

Tracking options consists of two groups; Jitter Control Group(JITTER_REDUCTION_ACTIVATION and JITTER_REDUCTION_DEACTIVATION) and Functionaliy Control Group(NORMAL_TRACKING, ENHANCED_TRACKING, EXTENDED_TRACKING, and MULTI_TRACKING).
In each group, only one option is selected. The default option in Jitter Control Group is JITTER_REDUCTION_DEACTIVATION and the default in Functionaliy Control Group is NORMAL_TRACKING. Each option works on the different trackers, so please check which tracker supports which options.

Parameters
optiontracking option TrackingOption.JITTER_REDUCTION_ACTIVATION : Jitter Reduction Activation (It works on Marker, Image, Instant, QRCode)
TrackingOption.JITTER_REDUCTION_DEACTIVATION : Jitter Reduction Deactivation (Marker, Image)
TrackingOption.NORMAL_TRACKING : Normal Tracking (It works on Marker, Image, and Object Tracker.)
TrackingOption.ENHANCED_TRACKING : Enhanced Tracking (It works on Marker Tracker.)
TrackingOption.EXTENDED_TRACKING : Extended Tracking (It works on Image and Object Traker.)
TrackingOption.MULTI_TRACKING : Multiple Target Tracking (It works only on Image Tracker.)

◆ startTracker()

void com.maxst.ar.TrackerManager.startTracker ( int  trackerType)

Start a AR tracker.

MAXST AR provices the following trackers; Marker Tracker, QRcode Tracker, Image Tracker, Cloud Recognizer, Instant Tracker, Marker Fusion Tracker, QRCode Fusion Tracker, Image Fusion Tracker, Instant Fusion Tracker, Object Fusion Tracker, QR/Barcode Scanner.
Only one tracker can be run at one time.

Parameters
trackerTypetracker type (trackerType should be among TRACKER_TYPE_CODE_SCANNER, TRACKER_TYPE_IMAGE, TRACKER_TYPE_MARKER, TRACKER_TYPE_OBJECT, TRACKER_TYPE_INSTANT, TRACKER_TYPE_QR_TRACKER, TRACKER_TYPE_CLOUD_RECOGNIZER, TRACKER_TYPE_IMAGE_FUSION, TRACKER_TYPE_OBJECT_FUSION, TRACKER_TYPE_QR_FUSION, TRACKER_TYPE_MARKER_FUSION, and TRACKER_TYPE_INSTANT_FUSION.)

◆ stopTracker()

void com.maxst.ar.TrackerManager.stopTracker ( )

Stop a tracker.

◆ updateTrackingState()

TrackingState com.maxst.ar.TrackerManager.updateTrackingState ( )

Update and get the current tracking state.

Returns
the updated tracking state

Member Data Documentation

◆ TRACKER_TYPE_CLOUD_RECOGNIZER

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_CLOUD_RECOGNIZER = 0x30
static

Cloud Recognizer

◆ TRACKER_TYPE_CODE_SCANNER

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_CODE_SCANNER = 0X01
static

QR/Barcode scanner

◆ TRACKER_TYPE_IMAGE

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_IMAGE = 0X02
static

Image Tracker

◆ TRACKER_TYPE_IMAGE_FUSION

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_IMAGE_FUSION = 0x80
static

Image Fusion Tracker

◆ TRACKER_TYPE_INSTANT

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_INSTANT = 0x20
static

Instant Tracker

◆ TRACKER_TYPE_INSTANT_FUSION

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_INSTANT_FUSION = 0x10000
static

Instant Fusion Tracker

◆ TRACKER_TYPE_MARKER

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_MARKER = 0X04
static

Marker Tracker

◆ TRACKER_TYPE_MARKER_FUSION

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_MARKER_FUSION = 0x800
static

Marker Fusion Tracker

◆ TRACKER_TYPE_OBJECT

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_OBJECT = 0X08
static

Object Tracker

◆ TRACKER_TYPE_OBJECT_FUSION

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_OBJECT_FUSION = 0x100
static

Object Fusion Tracker

◆ TRACKER_TYPE_QR_FUSION

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_QR_FUSION = 0x400
static

QRCode Fusion Tracker

◆ TRACKER_TYPE_QR_TRACKER

final int com.maxst.ar.TrackerManager.TRACKER_TYPE_QR_TRACKER = 0x40
static

QRCode Tracker