• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RelicRecoveryVuMark类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark的典型用法代码示例。如果您正苦于以下问题:Java RelicRecoveryVuMark类的具体用法?Java RelicRecoveryVuMark怎么用?Java RelicRecoveryVuMark使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RelicRecoveryVuMark类属于org.firstinspires.ftc.robotcore.external.navigation包,在下文中一共展示了RelicRecoveryVuMark类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getVuMarkPosition

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
public VectorF getVuMarkPosition()
{
    VectorF targetPos = null;
    VuforiaTrackable target = vuforia.getTarget(0);
    RelicRecoveryVuMark vuMark = RelicRecoveryVuMark.from(target);

    if (vuforia.isTargetVisible(target) && vuMark != RelicRecoveryVuMark.UNKNOWN)
    {
        OpenGLMatrix pose = vuforia.getTargetPose(target);
        if (pose != null)
        {
            targetPos = pose.getTranslation();
            robot.tracer.traceInfo("TargetPos", "%s: x=%6.2f, y=%6.2f, z=%6.2f",
                                   vuMark.toString(),
                                   targetPos.get(0)/RobotInfo.MM_PER_INCH,
                                   targetPos.get(1)/RobotInfo.MM_PER_INCH,
                                   -targetPos.get(2)/RobotInfo.MM_PER_INCH);
        }
    }

    return targetPos;
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:23,代码来源:VuforiaVision.java


示例2: getVuMarkOrientation

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
public Orientation getVuMarkOrientation()
{
    Orientation targetAngle = null;
    VuforiaTrackable target = vuforia.getTarget(0);
    RelicRecoveryVuMark vuMark = RelicRecoveryVuMark.from(target);

    if (vuforia.isTargetVisible(target) && vuMark != RelicRecoveryVuMark.UNKNOWN)
    {
        OpenGLMatrix pose = vuforia.getTargetPose(target);
        if (pose != null)
        {
            targetAngle = Orientation.getOrientation(
                    pose, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES);
            robot.tracer.traceInfo("TargetRot", "%s: xRot=%6.2f, yRot=%6.2f, zRot=%6.2f",
                    vuMark.toString(),
                    targetAngle.firstAngle, targetAngle.secondAngle, targetAngle.thirdAngle);
        }
    }

    return targetAngle;
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:22,代码来源:VuforiaVision.java


示例3: updateVuforia

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
public void updateVuforia(){
    //OpenGLMatrix latestLocation = listener.getUpdatedRobotLocation();
    vuMark = RelicRecoveryVuMark.from(relicVuMark);

    /*
    if(latestLocation !=null)
    {lastKnownLocation = latestLocation;}

    float[] coordinates = lastKnownLocation.getTranslation().getData();

    robotX = coordinates[0];
    robotY = coordinates[1];
    robotAngle = Orientation.getOrientation(lastKnownLocation, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES).thirdAngle;
    */
    if (vuMark != RelicRecoveryVuMark.UNKNOWN) {
        key = vuMark;
    }
    robot.telemetry.addData("key", key);
    robot.telemetry.update();
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:21,代码来源:Navi.java


示例4: getVuMarkPosition

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
private VectorF getVuMarkPosition()
{
    VectorF targetPos = null;
    VuforiaTrackable target = vuforia.getTarget(0);
    RelicRecoveryVuMark vuMark = RelicRecoveryVuMark.from(target);

    if (vuforia.isTargetVisible(target) && vuMark != RelicRecoveryVuMark.UNKNOWN)
    {
        OpenGLMatrix pose = vuforia.getTargetPose(target);
        if (pose != null)
        {
            targetPos = pose.getTranslation();
        }
    }

    return targetPos;
}
 
开发者ID:trc492,项目名称:FtcSamples,代码行数:18,代码来源:FtcTestVuMark.java


示例5: getVuMarkOrientation

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
private Orientation getVuMarkOrientation()
{
    Orientation targetAngle = null;
    VuforiaTrackable target = vuforia.getTarget(0);
    RelicRecoveryVuMark vuMark = RelicRecoveryVuMark.from(target);

    if (vuforia.isTargetVisible(target) && vuMark != RelicRecoveryVuMark.UNKNOWN)
    {
        OpenGLMatrix pose = vuforia.getTargetPose(target);
        if (pose != null)
        {
            targetAngle = Orientation.getOrientation(
                    pose, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES);
        }
    }

    return targetAngle;
}
 
开发者ID:trc492,项目名称:FtcSamples,代码行数:19,代码来源:FtcTestVuMark.java


示例6: doVisionTest

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
private void doVisionTest()
{
    if (robot.vuforiaVision != null)
    {
        robot.vuforiaVision.getVuMarkPosition();
        robot.vuforiaVision.getVuMarkOrientation();
        RelicRecoveryVuMark vuMark = robot.vuforiaVision.getVuMark();
        if (vuMark != robot.prevVuMark)
        {
            String sentence = null;
            if (vuMark != RelicRecoveryVuMark.UNKNOWN)
            {
                sentence = String.format("%s is %s.", vuMark.toString(), "in view");
            }
            else if (robot.prevVuMark != null)
            {
                sentence = String.format("%s is %s.", robot.prevVuMark.toString(), "out of view");
            }

            if (sentence != null)
            {
                robot.dashboard.displayPrintf(11, sentence);
                if (robot.textToSpeech != null)
                {
                    robot.textToSpeech.speak(sentence, TextToSpeech.QUEUE_FLUSH, null);
                }
            }
        }
        robot.prevVuMark = vuMark;
    }
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:32,代码来源:FtcTest.java


示例7: runOpMode

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
public void runOpMode() throws InterruptedException
{
	setupVuforia();
	
	lastKnownLocation = createMatrix(0,0,0,0,0,0);
	
	waitForStart();
	
	visionTargets.activate();
	while(opModeIsActive())
	{
		OpenGLMatrix latestLocation = listener.getUpdatedRobotLocation();
		vuMark = RelicRecoveryVuMark.from(relicVuMark);
	
		if(latestLocation !=null)
		{lastKnownLocation = latestLocation;}
			
		float[] coordinates = lastKnownLocation.getTranslation().getData();
		
		robotX = coordinates[0];
		robotY = coordinates[1];
		robotAngle = Orientation.getOrientation(lastKnownLocation, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES).thirdAngle;
           RelicRecoveryVuMark key = vuMark;
		if (vuMark != RelicRecoveryVuMark.UNKNOWN) {
               telemetry.addData("Navi", "%s visible", vuMark);
           }else{
               telemetry.addData("Navi", "not visible");
               telemetry.addData("Navi Sees:", vuMark);
           }
		telemetry.addData("Last Known Location", formatMatrix(lastKnownLocation));
		telemetry.addData("key",key.toString());
		telemetry.update();
	}
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:35,代码来源:Vuforia.java


示例8: init

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
@Override
public void init(){
    key = RelicRecoveryVuMark.UNKNOWN;
    setupVuforia();
    startVuforia();
    for(int i=0;i<10;i++){
        updateVuforia();
    }
    if(key!=RelicRecoveryVuMark.UNKNOWN){
        stopVuforia();
    }
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:13,代码来源:Navi.java


示例9: runOpMode

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
public void runOpMode() throws InterruptedException
{
    setupVuforia();

    lastKnownLocation = createMatrix(0,0,0,0,0,0);

    waitForStart();

    visionTargets.activate();
    while(opModeIsActive())
    {
        OpenGLMatrix latestLocation = listener.getUpdatedRobotLocation();
        vuMark = RelicRecoveryVuMark.from(relicVuMark);

        if(latestLocation !=null)
        {lastKnownLocation = latestLocation;}

        float[] coordinates = lastKnownLocation.getTranslation().getData();

        robotX = coordinates[0];
        robotY = coordinates[1];
        robotAngle = Orientation.getOrientation(lastKnownLocation, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES).thirdAngle;
        if (vuMark != RelicRecoveryVuMark.UNKNOWN) {
            key = vuMark;
        }
    }
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:28,代码来源:BasicVuforia.java


示例10: getInput

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
@Override
public double getInput(TrcPidController pidCtrl)
{
    final String funcName = "getInput";
    double input = 0.0;

    if (pidCtrl == encoderXPidCtrl)
    {
        input = driveBase.getXPosition();
        if (prevXDistance != null && Math.abs(input - prevXDistance) >= 5.0)
        {
            tracer.traceWarn(funcName, "Detected invalid X position (prev=%.3f, curr=%.3f).",
                    prevXDistance, input);
            xOffset += input - prevXDistance;
        }
        prevXDistance = input;
        input -= xOffset;
    }
    else if (pidCtrl == encoderYPidCtrl)
    {
        input = driveBase.getYPosition();
    }
    else if (pidCtrl == gyroPidCtrl)
    {
        input = driveBase.getHeading();
    }
    else if (pidCtrl == visionPidCtrl)
    {
        RelicRecoveryVuMark vuMark = vuforiaVision.getVuMark();

        if (vuMark != RelicRecoveryVuMark.UNKNOWN)
        {
            input = vuforiaVision.getVuMarkPosition().get(0)/RobotInfo.MM_PER_INCH;
        }

        if (textToSpeech != null && vuMark != prevVuMark)
        {
            String sentence = null;

            if (vuMark != RelicRecoveryVuMark.UNKNOWN)
            {
                sentence = String.format("%s is %s.", vuMark.toString(), "in view");
            }
            else if (prevVuMark != null)
            {
                sentence = String.format("%s is %s.", prevVuMark.toString(), "out of view");
            }

            if (sentence != null)
            {
                textToSpeech.speak(sentence, TextToSpeech.QUEUE_FLUSH, null);
            }
        }
    }
    else if (pidCtrl == rangeXPidCtrl)
    {
        input = getRangeDistance(useRightSensorForX? rightRangeSensor: leftRangeSensor);
    }
    else if (pidCtrl == sonarXPidCtrl)
    {
        if (useRightSensorForX)
        {
            input = sonarArray.getDistance(RIGHT_SONAR_INDEX).value;
        }
        else
        {
            input = sonarArray.getDistance(LEFT_SONAR_INDEX).value;
        }
    }
    else if (pidCtrl == sonarYPidCtrl)
    {
        //
        // Read front sonar value.
        //
        input = sonarArray.getDistance(FRONT_SONAR_INDEX).value;
    }

    return input;
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:80,代码来源:Robot.java


示例11: getVuMark

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
public RelicRecoveryVuMark getVuMark()
{
    return RelicRecoveryVuMark.from(vuforia.getTarget(0));
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:5,代码来源:VuforiaVision.java


示例12: loop

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
@Override
public void loop(){
    OpenGLMatrix latestLocation = listener.getUpdatedRobotLocation();
    vuMark = RelicRecoveryVuMark.from(relicVuMark);

    if(latestLocation !=null) {lastKnownLocation = latestLocation;}
    float[] coordinates = lastKnownLocation.getTranslation().getData();
    robotX = coordinates[0];
    robotY = coordinates[1];
    robotAngle = Orientation.getOrientation(lastKnownLocation, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES).thirdAngle;
    if (vuMark != RelicRecoveryVuMark.UNKNOWN) {
        key = vuMark;
    }
    double x = gamepad1.right_stick_x;
    double y = gamepad1.right_stick_y;
    double c = gamepad1.left_trigger-gamepad1.right_trigger;
    motor1.setPower(Range.clip(y-x+c, -1, 1));
    motor2.setPower(Range.clip(y+x-c, -1, 1));
    motor3.setPower(Range.clip(y+x+c, -1, 1));
    motor4.setPower(Range.clip(y-x-c, -1, 1));

    if (gamepad2.right_trigger > 0) {
        leftcr.setPower(1);
        rightcr.setPower(1);
    }else if(gamepad2.left_trigger > 0) {
        leftcr.setPower(-1);
        rightcr.setPower(-1);
    }else {
        leftcr.setPower(0.1);
        rightcr.setPower(0);
    }
    if(gamepad2.x) {
        glyph.setPosition(1);
    }
    else if(gamepad2.a) {
        glyph.setPosition(0);
    }
    else if(gamepad2.b) {
        glyph.setPosition(-1);
    }

    telemetry.addData("motor 1 pos", motor1.getCurrentPosition());
    telemetry.addData("motor 2 pos", motor2.getCurrentPosition());
    telemetry.addData("motor 3 pos", motor3.getCurrentPosition());
    telemetry.addData("motor 4 pos", motor4.getCurrentPosition());
    telemetry.addData("jewel servo pos", jewelcr.getPower());
    updateLocation();
    telemetry.addData("Last Known Location", formatMatrix(lastKnownLocation));

    telemetry.addData("Red",color1.red());
    telemetry.addData("Blue",color1.blue());

    telemetry.update();
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:55,代码来源:MecanumDebug.java


示例13: runPeriodic

import org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark; //导入依赖的package包/类
@Override
public void runPeriodic(double elapsedTime)
{
    double startTime;

    startTime = TrcUtil.getCurrentTime();
    RelicRecoveryVuMark vuMark = RelicRecoveryVuMark.from(vuforia.getTarget(0));
    dashboard.displayPrintf(1, "ElapseTime: getTarget=%f", TrcUtil.getCurrentTime() - startTime);

    if (vuMark != RelicRecoveryVuMark.UNKNOWN)
    {
        startTime = TrcUtil.getCurrentTime();
        VectorF pos = getVuMarkPosition();
        Orientation orientation = getVuMarkOrientation();
        dashboard.displayPrintf(2, "ElapseTime: getVuMarkInfo=%f", TrcUtil.getCurrentTime() - startTime);

        dashboard.displayPrintf(3, "%s: x=%6.2f,y=%6.2f,z=%6.2f",
                vuMark.toString(), pos.get(0)/MM_PER_INCH, pos.get(1)/MM_PER_INCH, pos.get(2)/MM_PER_INCH);
        dashboard.displayPrintf(4, "%s: xRot=%6.2f,yRot=%6.2f,zRot=%6.2f",
                vuMark.toString(), orientation.firstAngle, orientation.secondAngle, orientation.thirdAngle);
    }

    if (vuMark != prevVuMark)
    {
        String sentence = null;

        if (vuMark != RelicRecoveryVuMark.UNKNOWN)
        {
            sentence = String.format("%s is %s.", vuMark.toString(), "in view");
        }
        else if (prevVuMark != null)
        {
            sentence = String.format("%s is %s.", prevVuMark.toString(), "out of view");
        }

        if (sentence != null)
        {
            dashboard.displayPrintf(5, sentence);
            if (textToSpeech != null)
            {
                //
                // ZTE phones are on KitKat and running level 19 APIs, so we need to use the deprecated version
                // to be compatible with it.
                //
                textToSpeech.speak(sentence, TextToSpeech.QUEUE_FLUSH, null);
            }
        }

        prevVuMark = vuMark;
    }
}
 
开发者ID:trc492,项目名称:FtcSamples,代码行数:52,代码来源:FtcTestVuMark.java



注:本文中的org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LazyDynaClass类代码示例发布时间:2022-05-23
下一篇:
Java ContextService类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap