Package edu.wpi.first.wpilibj

Examples of edu.wpi.first.wpilibj.CANJaguar


    public static Vector scanCAN(int[] ids, boolean debug){
        Vector v = new Vector();
        for(int j = 0; j<ids.length; j++){
            try {
                new CANJaguar(ids[j]);
            } catch (CANTimeoutException ex) {
                if(debug){
                    GRTLogger.extLog("Util","Fail on CANJag id "+ ids[j] );
                    ex.printStackTrace();
                }
View Full Code Here


    public GRTCANJaguar(int channel, int controlMode) {
        listeners = new Vector();
        try {
            switch (controlMode) {
                case PERCENT_CONTROL:
                    jaguar = new CANJaguar(channel,
                            CANJaguar.ControlMode.kPercentVbus);
                    break;
                case SPEED_CONTROL:
                    jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kSpeed);
                    break;
                case POSITION_CONTROL:
                    jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kPosition);
                    break;
                case CURRENT_CONTROL:
                    jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kCurrent);
                    break;
                case VOLTAGE_CONTROL:
                    jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kVoltage);
                default:
                    jaguar = new CANJaguar(channel);
            }
        } catch (CANTimeoutException e) {
            notifyCANTimeout();
        }
    }
View Full Code Here

            KD = LOWER_KD;
        }
    }

    public void jaguarInit() throws CANTimeoutException {
        jaguar = new CANJaguar(CANid);
        jaguar.changeControlMode(CANJaguar.ControlMode.kSpeed);
        jaguar.setSpeedReference(CANJaguar.SpeedReference.kQuadEncoder);
        jaguar.configEncoderCodesPerRev(ENCODER_CODES_PER_REV);
        jaguar.setPID(KP, KI, KD);
        jaguar.configFaultTime(0.5);
View Full Code Here

TOP

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

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.