Package edu.wpi.first.wpilibj

Examples of edu.wpi.first.wpilibj.Encoder


        cc = new CriteriaCollection();
        cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_WIDTH, 40, 400, false);
        cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_HEIGHT, 55, 400, false);
       
        enc_FrontLeft = new Encoder(RobotMap.ENC_FRONT_LEFTA, RobotMap.ENC_FRONT_LEFTB);
        enc_FrontRight = new Encoder(RobotMap.ENC_FRONT_RIGHTA, RobotMap.ENC_FRONT_RIGHTB);
        enc_RearLeft = new Encoder(RobotMap.ENC_REAR_LEFTA, RobotMap.ENC_REAR_LEFTB);
        enc_RearRight = new Encoder(RobotMap.ENC_REAR_RIGHTA, RobotMap.ENC_REAR_RIGHTB);

        enc_FrontLeft.start();
        enc_FrontRight.start();
        enc_RearLeft.start();
        enc_RearRight.start();
View Full Code Here


        this(channela, channelb, pollTime, DIST_PER_PULSE, id);
    }

    public GRTEncoder(int channela, int channelb, int pollTime,
                                double pulseDistance, String id){
        rotaryEncoder = new Encoder(channela, channelb);
        rotaryEncoder.start();
        rotaryEncoder.setDistancePerPulse(pulseDistance);
        setSleepTime(pollTime);
        encoderListeners = new Vector();
        this.id = id;
View Full Code Here

    private Vector encoderListeners;
    public static final double DIST_PER_PULSE = Math.PI * 16.0/(360 * 4 *12);


    public GRTEncoder(int channela, int channelb, int pollTime, String id){
        rotaryEncoder = new Encoder(channela, channelb);
        rotaryEncoder.start();
        rotaryEncoder.setDistancePerPulse(DIST_PER_PULSE);
        setSleepTime(pollTime);
        encoderListeners = new Vector();
        this.id = id;
View Full Code Here

    private Vector encoderListeners;
    public static final double DIST_PER_PULSE = Math.PI * 16/(360 * 4 *12);


    public GRTEncoder(int channela, int channelb, int pollTime, String id){
        rotaryEncoder = new Encoder(channela, channelb);
        rotaryEncoder.start();
        rotaryEncoder.setDistancePerPulse(DIST_PER_PULSE);
        setSleepTime(pollTime);
        encoderListeners = new Vector();
        this.id = id;
View Full Code Here

        LiveWindow.addActuator("CATAPULT", "winchMotor", new PWM(RobotMap.winchMotor));
        LiveWindow.addActuator("CATAPULT", "latchServo", new PWM(RobotMap.latchServo));
       
       
        //sensors
        LiveWindow.addSensor("CATAPULT", "winchEncoder", new Encoder(RobotMap.winchEncoderA, RobotMap.winchEncoderB, false));
        LiveWindow.addSensor("CATAPULT", "limitSwitch", new DigitalInput(RobotMap.limitSwitch));
       
    }
View Full Code Here

     */
    public VictorSpeed(int victorChannel, int encoderAChannel, int encoderBChannel) {
        speedSetpoint = 0;
        victor = new Victor(victorChannel);

        encoder = new Encoder(encoderAChannel, encoderBChannel, false, CounterBase.EncodingType.k4X);
        encoder.setDistancePerPulse(ENCODER_RPM_PER_PULSE);
        encoder.setPIDSourceParameter(Encoder.PIDSourceParameter.kRate); // use e.getRate() for feedback
        encoder.start();

        controller = new PIDController(KP, KI, KD, encoder, victor);
View Full Code Here

TOP

Related Classes of edu.wpi.first.wpilibj.Encoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.