public AutonomousModeHandler(Encoder enc1, Encoder enc2, RobotDrivePID robotoDrive, AxisCamera cam, ConfigurableValues configurableValues, IntakeControl frontIntake, IntakeControl backIntake, ShooterControl shooterControl, DigitalInput frontIntakeArmAngleDetector) { m_configurableValues = configurableValues; m_shooterControl = shooterControl; m_robotDrivePid = robotoDrive; m_frontIntake = frontIntake; m_backIntake = backIntake; m_frontIntakeArmAngleDetector = frontIntakeArmAngleDetector; m_driveEncoder1 = enc1; m_driveEncoder2 = enc2; m_encoderAverager = new EncoderAverager(m_driveEncoder1, m_driveEncoder2); m_autonomousImageDetector = new AutonomousImageDetector(cam,m_configurableValues); m_nextStateArray= new byte[256]; m_motorBrake = new MotorBrake(); SetCurrentState(AUTONOMOUS_HANDLER_STATE_WAIT); SetNextStateArray(AUTONOMOUS_MODE_1_BALL_SHOOTING); m_overrideCoefficients = false; m_pidController = null; m_disabled = true; m_shootingBall = false; m_driving = false; m_braking = false; m_detectingImage = false; m_currentStateIndex = 0; m_loadingBall = false; m_shooterPullingBack = false; }
protected void robotInit() { dsout = new DSOutput(); System.out.println("Loading " + fullname); dsout.clearOutput(); dsout.say(1, "Loading..."); Timer.delay(1); acam = AxisCamera.getInstance("10.28.79.11"); dsout.say(1, "Welcome to"); dsout.say(2, fullname); }
protected void robotInit() { Debug.clear(); Debug.log(1, 1, "Robot Initalized"); state = START; lastUpdate = System.currentTimeMillis(); motorTime = 0L; vertHeight = 0; drive.initializeDrive(LEFT_DRIVE_FRONT, LEFT_DRIVE_REAR, RIGHT_DRIVE_FRONT, RIGHT_DRIVE_REAR); //drive.initializeDrive(6, 4); drive.setSafety(false); intake = new VexSpike(INTAKE_SPIKE); intake2 = new VexSpike(INTAKE_SPIKE_2); //special spike intake2.deactivate(); //special spike intake.deactivate(); winch = new VexSpike(WINCH_SPIKE); drive.addVictor(TRIGGER_PORT); drive.addVictor(WINCH_PORT); //trigger = new Victor(TRIGGER_PORT); camera = AxisCamera.getInstance("10.40.79.11"); cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 400, 65535, false); //camera = AxisCamera.getInstance("10.40.79.11"); horzCenterMassX = 0.0; horzCenterMassY = 0.0; vertCenterMassX = 0.0; vertCenterMassY = 0.0; System.out.println("End of Robot Init"); }
public void robotInit() { System.out.println("-- 2014 Target Test --"); camera = AxisCamera.getInstance(); // get an instance of the camera cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(MeasurementType.IMAQ_MT_AREA, AREA_MINIMUM, 65535, false); }
FRC2014Java(){ //Motor Controllers leftDrive = new Talon(TALON_PORT_L); rightDrive = new Talon(TALON_PORT_R); //Joystick xbox = new Joystick(1); //Winch winch = new Talon(2); //Intake intake = new Talon(8); //Cam cam = new Talon(3); //Catapult Limit Switch catapultLimit = new DigitalInput(1); //Cam Limit Switch camLimit = new DigitalInput(2); //Intake Limit Switch intakeLimit = new DigitalInput(3); //Cameras cameraFront = AxisCamera.getInstance("10.10.2.11"); cameraBack = AxisCamera.getInstance("10.10.2.12"); //Watchdog dog = Watchdog.getInstance(); }
public PillowCam() { camera = AxisCamera.getInstance(); cc = new CriteriaCollection(); cc.addCriteria(MeasurementType.IMAQ_MT_AREA, AREA_MIN, AREA_MAX, false); ccLeft = new CriteriaCollection(); ccLeft.addCriteria(MeasurementType.IMAQ_MT_FIRST_PIXEL_X, 0, 120, false); ccRight = new CriteriaCollection(); ccRight.addCriteria(MeasurementType.IMAQ_MT_FIRST_PIXEL_X, 200, 320, false); }
private VisionController() { camera = AxisCamera.getInstance(); cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, AREA_MINIMUM, 65535, false); target = new TargetReport(); verticalTargets = new int[MAX_PARTICLES]; horizontalTargets = new int[MAX_PARTICLES]; }
public CameraUnit() { camera = AxisCamera.getInstance(ReboundRumble.CAMERA_IP); camera.writeResolution(AxisCamera.ResolutionT.k320x240); camera.writeExposurePriority(AxisCamera.ExposurePriorityT.imageQuality); camera.writeExposureControl(AxisCamera.ExposureT.hold); camera.writeWhiteBalance(AxisCamera.WhiteBalanceT.fixedIndoor); cc = new CriteriaCollection(); cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_WIDTH, 15, 400, false); cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_HEIGHT, 15, 400, false); cameraPan = new Servo(1, 6); cameraTilt = new Servo(1, 7); }
public Vision() { if (enableVision) camera = AxisCamera.getInstance("10.25.2.11"); lastFrame = System.currentTimeMillis(); frameProcess = 0; cc = new CriteriaCollection(); cc.addCriteria(MeasurementType.IMAQ_MT_AREA, 3000, 6000, false); distanceReg = new Regression(0.0000086131992, -0.0893246981, 244.5414525); // a, b, c angleReg = new Regression(15.32142857, -565.2928571, 5720.678571); // a, b, c SmartDashboard.putNumber("Angle Regression Constant", angleReg.getConstant()); }
public void robotInit() { camera = AxisCamera.getInstance(); cc = new CriteriaCollection(); cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_WIDTH, 0, 0, false); cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_HEIGHT, 0, 0, false); //todo: check WPILibJ documentation SmartDashboard.putBoolean("Grab state", false); SmartDashboard.putBoolean("Lift state", false); System.out.println("RobotInit() completed. \n"); }
public ImageProcesser(UltimateAscentRobot robot){ super(robot); //roboRealm. driverStation = NetworkTable.getTable("SmartDashboard"); // try { // NetworkTable.initialize(); // } catch (IOException ex) { // ex.printStackTrace(); // } camera = AxisCamera.getInstance("10.36.95.11"); camera.writeCompression(40); camera.writeResolution(AxisCamera.ResolutionT.k320x240); camera.writeExposureControl(AxisCamera.ExposureT.automatic); camera.writeRotation(AxisCamera.RotationT.k0); highGoal = null; leftMiddleGoal = null; rightMiddleGoal = null; lowGoal = null; leftSeparator = null; rightSeparator = null; post = null; bar = null; }
public GRTVisionTracker(AxisCamera cam) { super("Vision Tracker", NUM_DATA); this.camera = cam; this.cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 500, 65535, false); X_IMAGE_RES = camera.getResolution().width; listeners = new Vector(); }
public CameraSubsystem() { // super(kp, ki, kd); try { cam = AxisCamera.getInstance(); cam.writeResolution(AxisCamera.ResolutionT.k320x240); } catch(Exception e) { cam = null; System.out.println("Could not connect to camera."); } cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_BOUNDING_RECT_HEIGHT, MIN_HEIGHT, MAX_HEIGHT, true); cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_BOUNDING_RECT_WIDTH, MIN_WIDTH, MAX_WIDTH, true); // this.setSetpoint(160); // this.setAbsoluteTolerance(.03); }
public AutonomousImageDetector(AxisCamera cam, ConfigurableValues configurableValues) { m_configurableValues = configurableValues; m_camera = cam; }
public ImageProPart(BotRunner runner){ super(runner); AxisCamera.getInstance("10.36.95.11"); }
public AxisCameraM1101() { camera = AxisCamera.getInstance(); criteriaCollection = new CriteriaCollection(); criteriaCollection.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, AREA_MINIMUM, 65535, true); }
public ShooterComputer() { camera = AxisCamera.getInstance(RobotMap.CAMERA_IP); // get an instance of the camera cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(MeasurementType.IMAQ_MT_AREA, 500, 65535, false); prefs = Preferences.getInstance(); }
public void robotInit() { camera = AxisCamera.getInstance("10.35.28.11"); // get an instance of the camera cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(MeasurementType.IMAQ_MT_AREA, AREA_MINIMUM, 65535, false); }
public void init() { camera = AxisCamera.getInstance(); cc = new CriteriaCollection(); cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 200, 65536, false); }
public CameraSubsystem() { cam = AxisCamera.getInstance("10.6.49.11"); }
public VisionTracker(){ this.camera = AxisCamera.getInstance(); cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(MeasurementType.IMAQ_MT_AREA, AREA_MINIMUM, 65535, false); }
public BTVision() { camera = AxisCamera.getInstance(); // get an instance of the camera cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 500, 65535, false); }
public BTVision() { camera = AxisCamera.getInstance(); // get an instance of the camera cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 420, 65535, false); }
public Drivetrain() { frontLeft = new Victor(RobotMap.frontLeftVictor); rearLeft = new Victor(RobotMap.rearLeftVictor); frontRight = new Victor(RobotMap.frontRightVictor); rearRight = new Victor(RobotMap.rearRightVictor); drive = new RobotDrive(frontLeft, rearLeft, frontRight, rearRight); leftEncoder = new Encoder(RobotMap.leftDriveEncoderA, RobotMap.leftDriveEncoderB); rightEncoder = new Encoder(RobotMap.rightDriveEncoderA, RobotMap.rightDriveEncoderB); gyro = new Gyro(RobotMap.gyro); camera = AxisCamera.getInstance("10.32.66.11"); // try { // cImage = new RGBImage(); // bImage = (BinaryImage) new MonoImage(); // } catch (NIVisionException ex) { // ex.printStackTrace(); // } redLow = 10; redHigh = 155; greenLow = 140; greenHigh = 255; blueLow = 140; blueHigh = 255; leftEncoder.setPIDSourceParameter(Encoder.PIDSourceParameter.kDistance); rightEncoder.setPIDSourceParameter(Encoder.PIDSourceParameter.kDistance); leftDriveOutput = new LeftDriveOutput(); rightDriveOutput = new RightDriveOutput(); leftPID = new PIDController(RobotMap.driveLowKp, RobotMap.driveLowKi, RobotMap.driveLowKd, leftEncoder, leftDriveOutput); rightPID = new PIDController(RobotMap.driveLowKp, RobotMap.driveLowKi, RobotMap.driveLowKd, rightEncoder, rightDriveOutput); leftPID.setOutputRange(-1.0, 1.0); rightPID.setOutputRange(-1.0, 1.0); leftEncoder.setDistancePerPulse(-RobotMap.driveEncoderDistancePerPulse); rightEncoder.setDistancePerPulse(RobotMap.driveEncoderDistancePerPulse); }
public void initDefaultCommand() { axis = AxisCamera.getInstance(); }
vision() { camera = AxisCamera.getInstance("10.14.82.12"); cc = new CriteriaCollection(); // create the criteria for the particle filter cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 500, 65535, false); }