Vuforia

The Vuforia Library

Vuforia is a library often used with vision detection for FTC. To use Vuforia, you will need to obtain a Vuforia license key. Luckily, this process is simple and steps can be found here.

Instantiating Vuforia

Once you have gotten the license key, you must start the initialization of Vuforia. Start with these two lines.

String VUFORIA_KEY = "Vuforia Key Goes Here"
VuforiaLocalizer vuforia;

Parameters

Now we must further initialize the Vuforia Engine but passing the necessary parameters for it to run. Just paste this line into your initialization.

int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName());
VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters(cameraMonitorViewId);

Now we since we have created the parameters object, we can pass in the actual parameters.

parameters.vuforiaLicenseKey = VUFORIA_KEY;
parameters.cameraDirection = BACK; //Making sure to use the right camera

Paste these lines to pass everything into and actually startup the Vuforia Engine

vuforia = ClassFactory.getInstance().createVuforia(parameters);

vuforia.setFrameQueueCapacity(1);

vuforia.enableConvertFrameToBitmap();

Last updated