本文整理汇总了Java中org.firstinspires.ftc.robotcore.external.ClassFactory类的典型用法代码示例。如果您正苦于以下问题:Java ClassFactory类的具体用法?Java ClassFactory怎么用?Java ClassFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassFactory类属于org.firstinspires.ftc.robotcore.external包,在下文中一共展示了ClassFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FtcVuforia
import org.firstinspires.ftc.robotcore.external.ClassFactory; //导入依赖的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.ClassFactory; //导入依赖的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.ClassFactory; //导入依赖的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.ClassFactory; //导入依赖的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.ClassFactory; //导入依赖的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: build
import org.firstinspires.ftc.robotcore.external.ClassFactory; //导入依赖的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);
}
示例7: setupVuforia
import org.firstinspires.ftc.robotcore.external.ClassFactory; //导入依赖的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);
}