Try MAXST AR Fusion Tracker Now ✨

Instant Fusion Tracker

Related documentations
Tracker Coordinate System

The Instant Tracker instantly scans the planar surface in the camera frame and recognizes the space with sensors. You can find the rendered 3D object on the space. After target recognition and initial poses are acquired through the MAXST SDK, use ARCore for tracking.
※To use the AR Core, you must enter the actual size. (See Start / Stop Tracker)

The biggest difference from the existing Instant Tracker is that the existing Instant Tracker tracks through the frame input from the RGB camera. Due to the nature of RGB cameras, tracking will be lost if the target deviates from the camera frame or if there are few feature points. Instant Fusion Tracker, on the other hand, tracks through the AR Core, which allows the target to deviate from the camera frame or keep the feature point at least without tracking, due to the nature of learning the environment in which the current target lies.

Start / Stop Tracker
Use Tracking Information
Create Instant Target Data
Hardware Requirements for Android

Start / Stop Tracker

TrackerManager.getInstance(). isFusionSupported ()
This function checks whether or not your device supports Fusion.
Return value is bool type. If true, it supports the device in use. If it is false, it does not support the device.

TrackerManager.getInstance().getFusionTrackingState ()
Pass the tracking status of the current Fusion.
The return value is an int of -1, which means that tracking isn't working properly, and 1 means that it's working properly.

To start / stop Tracker, refer to the following code.

>InstantFusionTrackerActivity.java

@Override
protected void onResume() {
    ...
   TrackerManager.getInstance().startTracker(TrackerManager.TRACKER_TYPE_INSTANT_FUSION);
    ...
}

@Override
protected void onPause() {
    ...
    TrackerManager.getInstance().stopTracker();
    ...
}

>InstantFusionTrackerRenderer.java

@Override
Public void onSurfaceCreated(…){
   …
   …
   CameraDevice.getInstance().setARCoreTexture();
}

The setARCoreTexture () function call must be made from glThread.
setARCoreTexture () must be executed. If the function is not executed, no screen is displayed.

Use Tracking Information

To augment an object using Tracking results, refer to the following code.

>InstantTrackerRenderer.java

public void onDrawFrame(GL10 unused) {
    ...
    
    TrackingState state = TrackerManager.GetInstance().UpdateTrackingState();
    TrackingResult trackingResult = state.GetTrackingResult(); 
    ...
    
    if (trackingResult.getCount() == 0) {
        return;
    }
    ...
    
    Trackable trackable = trackingResult.getTrackable(0);
    
    GLES20.glEnable(GLES20.GL_DEPTH_TEST);
    
    texturedCube.setTransform(trackable.getPoseMatrix());
    texturedCube.setTranslate(posX, posY, -0.05f);
    texturedCube.setProjectionMatrix(projectionMatrix);
    texturedCube.draw();
}

Create Instant Target Data

You can create new data only when it is not in Tracking state. Refer to the following code.

>InstantFusionTrackerActivity.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.start_tracking:
            String text = startTrackingButton.getText().toString();
            if (text.equals(getResources().getString(R.string.start_tracking))) {
                TrackerManager.getInstance().findSurface();
                instantImageTargetRenderer.resetPosition();
                startTrackingButton.setText(getResources().getString(R.string.stop_tracking));
            } else {
                TrackerManager.getInstance().quitFindingSurface();
                startTrackingButton.setText(getResources().getString(R.string.start_tracking));
            }
            break;
    }
}

Hardware Requirements for Android

MAXST AR SDK's Instant Fusion Tracker uses internally Android Rotation Vector related to both gyro and compass sensors.

If your target device has no gyro or compass sensor, the engine can not find the initial pose. If there is no sensor value, our engine assumes the front scene as a ground plane.

If you want to check whether the current device support Android Rotation Vector, please refer to the following codes.

 
SensorManager mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
List<Sensor> sensors = mSensorManager.getSensorList(TYPE_ROTATION_VECTOR);
Log.i(TAG, "# sensor : " + sensors.size());
for(int i=0; i<sensors.size(); i++)
{
   Log.i(TAG, sensors.get(i).getName());
}
if(sensors.isEmpty())
{
   Log.i(TAG,"There is no Rotaion Vector");
}

Devices that do not support the Android Rotation Vector

Samsung Galaxy J5, Moto G5 Plus, Moto G4 Plus, Iball Andi 5U, Geonee S +