微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

edu.wpi.first.wpilibj.Relay.Direction的实例源码

项目:STEAMworks    文件VisionTest.java   
public Visiontest() {
        UsbCamera camera = CameraServer.getInstance().startAutomaticCapture(); // cam0 by default
        camera.setResolution(IMG_WIDTH,IMG_HEIGHT);
        camera.setBrightness(0);
//      camera.setExposureManual(100);
        camera.setExposureAuto();

        CvSource cs= CameraServer.getInstance().putVideo("name",IMG_WIDTH,IMG_HEIGHT);

        visionThread = new VisionThread(camera,new gripPipeline(),pipeline -> {
            Mat IMG_MOD = pipeline.hslThresholdOutput();
            if (!pipeline.filterContoursOutput().isEmpty()) {
                //Rect recCombine = Imgproc.boundingRect(pipeline.filterContoursOutput().get(0));
                Rect recCombine = computeBoundingRectangle(pipeline.filterContoursOutput());
                if (recCombine == null) {
                    targetDetected = false;
                    return;
                }
                targetDetected = true;
                computeCoords(recCombine);
                synchronized (imgLock) {
                    centerX = recCombine.x + (recCombine.width / 2);
                }

                Imgproc.rectangle(IMG_MOD,new Point(recCombine.x,recCombine.y),new Point(recCombine.x + recCombine.width,recCombine.y + recCombine.height),new Scalar(255,20,0),5);

            } else {
                targetDetected = false;
            }

            cs.putFrame(IMG_MOD);
        });

        visionThread.start();
        Relay relay = new Relay(RobotMap.RELAY_CHANNEL,Direction.kForward);
        relay.set(Relay.Value.kOn);
        //this.processImage();
    }
项目:2013_drivebase_proto    文件WsRelay.java   
public WsRelay(int moduleNumber,int channel,Direction direction)
{
    relay = new Relay(moduleNumber,channel,direction);
}
项目:2014_software    文件WsRelay.java   
public WsRelay(int moduleNumber,direction);
}
项目:2013_robot_software    文件WsRelay.java   
public WsRelay(int moduleNumber,direction);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。