Skip to content
This repository was archived by the owner on Oct 27, 2020. It is now read-only.

Multiple cameras with Vuforia using SwitchableCamera #203

@Milotrince

Description

@Milotrince

Initializing Vuforia twice with different cameras always throws a no-camera-access error. But after looking through the sdk code (specifically VuforiaLocalizerImpl) I found that SwitchableCamera was a thing. It seems to suggest that running Vuforia on two separate cameras is possible by switching between them. What is the correct way to do this?

Setup: Control Hub with 2 web cameras connected.
Both work when run individually.

Here is how I am using SwitchableCamera

CameraName webcam1 = hardwareMap.get(WebcamName.class, "webcam 1");
CameraName webcam2 = hardwareMap.get(WebcamName.class, "webcam 2");
SwitchableCameraName switchableCameraName = SwitchableCameraNameImpl.forSwitchable(webcam1, webcam2);

VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters();
parameters.cameraName = switchableCameraName; 

// ...and then the rest of vuforia initialization

I believe that Impl classes are not really meant to be used directly, but I could not find another way to create SwitchableCameraName.

When running this in an OpMode, I do not get any readings (trackables are not visible), and calling setActiveCameraon (SwitchableCamera) vuforiaLocalizer.getCamera() throws errors.

I will post the models of the webcams, the code I am using, and the specific error messages in a day or two once I go to the workshop again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions