本文整理汇总了Java中org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer.Parameters方法的典型用法代码示例。如果您正苦于以下问题:Java VuforiaLocalizer.Parameters方法的具体用法?Java VuforiaLocalizer.Parameters怎么用?Java VuforiaLocalizer.Parameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer
的用法示例。
在下文中一共展示了VuforiaLocalizer.Parameters方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FtcVuforia
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
/**
* Constructor: Create an instance of this object. It initializes Vuforia with the specified target images and
* other parameters.
*
* @param licenseKey specifies the Vuforia license key.
* @param cameraViewId specifies the camera view ID on the activity, -1 if none given.
* @param cameraDir specifies which camera to use (front or back).
* @param trackablesFile specifies the XML file that contains the target info, can be null.
* @param numTargets specifies the number of simultaneous trackable targets.
* @param cameraMonitorFeedback specifies the feedback image showing the orientation of the target.
*/
public FtcVuforia(
String licenseKey, int cameraViewId, VuforiaLocalizer.CameraDirection cameraDir,
String trackablesFile, int numTargets,
VuforiaLocalizer.Parameters.CameraMonitorFeedback cameraMonitorFeedback)
{
this.cameraDir = cameraDir;
//
// If no camera view ID, do not activate camera monitor view to save power.
//
VuforiaLocalizer.Parameters params =
cameraViewId == -1? new VuforiaLocalizer.Parameters(): new VuforiaLocalizer.Parameters(cameraViewId);
params.vuforiaLicenseKey = licenseKey;
params.cameraDirection = cameraDir;
params.cameraMonitorFeedback = cameraMonitorFeedback;
localizer = ClassFactory.createVuforiaLocalizer(params);
Vuforia.setHint(HINT.HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS, numTargets);
if (trackablesFile != null)
{
targetList = localizer.loadTrackablesFromAsset(trackablesFile);
}
}
示例2: setupVuforia
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
public void setupVuforia()
{
parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking
parameters.vuforiaLicenseKey = VUFORIA_KEY;
parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
parameters.useExtendedTracking = false; //extended tracking is quite inaccurate
vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);
visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");
relicVuMark = visionTargets.get(0);
relicVuMark.setName("RelicVuMark");
relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));
phoneLocation = createMatrix(0,0,0,0,0,0);
listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
}
示例3: setupVuforia
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
public void setupVuforia()
{
parameters = new VuforiaLocalizer.Parameters(); //remove parameters to hide phone tracking
parameters.vuforiaLicenseKey = VUFORIA_KEY;
parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
parameters.useExtendedTracking = true; //extended tracking is quite inaccurate
vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);
visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");
relicVuMark = visionTargets.get(0);
relicVuMark.setName("RelicVuMark");
//relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));
//phoneLocation = createMatrix(0,0,0,0,0,0);
listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
//listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
}
示例4: setupVuforia
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
public void setupVuforia()
{
parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking
parameters.vuforiaLicenseKey = VUFORIA_KEY;
parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
parameters.useExtendedTracking = true; //extended tracking can be inaccurate
vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);
visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");
relicVuMark = visionTargets.get(0);
relicVuMark.setName("RelicRecovery");
relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));
phoneLocation = createMatrix(0,0,0,0,0,0);
listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
}
示例5: setupVuforia
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
public void setupVuforia()
{
parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking
parameters.vuforiaLicenseKey = VUFORIA_KEY;
parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
parameters.useExtendedTracking = false; //extended tracking is quite inaccurate
vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);
visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");
relicVuMark = visionTargets.get(0);
relicVuMark.setName("RelicVuMark");
relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));
phoneLocation = createMatrix(0,0,0,0,0,0);
listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
}
示例6: initVuforia
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
private VuforiaLocalizer.Parameters initVuforia () {
VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters();
parameters.cameraDirection = VuforiaLocalizer.CameraDirection.FRONT;
parameters.vuforiaLicenseKey = licenseKey;
parameters.cameraMonitorFeedback = VuforiaLocalizer.Parameters.CameraMonitorFeedback.AXES;
return parameters;
}
示例7: build
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
@NonNull
public static VuforiaLocalizer build(@NotNull String apiKey, @NotNull VuforiaLocalizer.CameraDirection direction, @IdRes int viewId, boolean extendingTracking) {
final VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters(viewId);
parameters.cameraDirection = direction;
parameters.vuforiaLicenseKey = apiKey;
parameters.useExtendedTracking = extendingTracking;
return ClassFactory.createVuforiaLocalizer(parameters);
}
示例8: VuforiaLocalizerBuilder
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
public VuforiaLocalizerBuilder(@NotNull String apiKey) {
this.apiKey = apiKey;
parameters = new VuforiaLocalizer.Parameters();
}
示例9: setupVuforia
import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入方法依赖的package包/类
public void setupVuforia()
{
parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking
parameters.vuforiaLicenseKey = VUFORIA_KEY;
parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
parameters.useExtendedTracking = true; //extended tracking can be inaccurate
vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);
visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");
relicVuMark = visionTargets.get(0);
relicVuMark.setName("RelicRecovery");
relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));
phoneLocation = createMatrix(0,0,0,0,0,0);
listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
}