当前位置: 首页>>代码示例>>Java>>正文


Java RobotMap类代码示例

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


RobotMap类属于edu.wpi.first.wpilibj.templates包,在下文中一共展示了RobotMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DriveTrain

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
/**
 *
 */
public DriveTrain() {
    super("DriveTrain");

    FLeftMotor = new Victor(RobotMap.FLeftMotorPWM);
    FRightMotor = new Victor(RobotMap.FRightMotorPWM);
    BLeftMotor = new Victor(RobotMap.BLeftMotorPWM);
    BRightMotor = new Victor(RobotMap.BRightMotorPWM);
    //MLeftMotor = new Victor(RobotMap.MLeftMotorPWM);
    //MRightMotor = new Victor(RobotMap.MRightMotorPWM);
    drive = new RobotDrive(FLeftMotor, BLeftMotor, FRightMotor, BRightMotor);
    //drive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
    //drive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);

    GShiftSolDown = new Solenoid(RobotMap.DriveTrainLowGearSolenoid);
    GShiftSolUp = new Solenoid(RobotMap.DriveTrainHighGearSolenoid);
    display = DriverStationLCD.getInstance();
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:21,代码来源:DriveTrain.java

示例2: RoboDrive

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public RoboDrive(){
    
    try {
        //creates the motors
        aLeft = new CANJaguar(RobotMap.LEFT_DRIVE_MOTOR_ALPHA);
        bLeft = new CANJaguar(RobotMap.LEFT_DRIVE_MOTOR_BETA);//, CANJaguar.ControlMode.kSpeed);
        aRight = new CANJaguar(RobotMap.RIGHT_DRIVE_MOTOR_ALPHA);
        bRight = new CANJaguar(RobotMap.RIGHT_DRIVE_MOTOR_BETA);//, CANJaguar.ControlMode.kSpeed);

        //creates the drive train
        roboDrive = new RobotDrive(aLeft, bLeft, aRight, bRight);
        roboDrive.setSafetyEnabled(false);  
        
    } catch(CANTimeoutException ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:18,代码来源:RoboDrive.java

示例3: Drivetrain

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public Drivetrain()
{
    frontModule = new SwerveModule(RobotMap.frontWheelEncoder, RobotMap.frontModuleEncoder, RobotMap.frontWheelMotor, RobotMap.frontModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, 0, RobotMap.FRONT_BACK_LENGTH/2, "frontModule");
    leftModule = new SwerveModule(RobotMap.leftWheelEncoder, RobotMap.leftModuleEncoder, RobotMap.leftWheelMotor, RobotMap.leftModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, -RobotMap.LEFT_RIGHT_WIDTH/2, 0, "leftModule");
    backModule = new SwerveModule(RobotMap.backWheelEncoder, RobotMap.backModuleEncoder, RobotMap.backWheelMotor, RobotMap.backModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, 0, -RobotMap.FRONT_BACK_LENGTH/2, "backModule");
    rightModule = new SwerveModule(RobotMap.rightWheelEncoder, RobotMap.rightModuleEncoder, RobotMap.rightWheelMotor, RobotMap.rightModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, RobotMap.LEFT_RIGHT_WIDTH/2, 0, "rightModule");
    
    //We were having occasional errors with the creation of the nav6 object, so we make 5 attempts before allowing the error to go through and being forced to redeploy.
    int count = 0;
    int maxTries = 5;
    while(true) {
        try {
            nav6 = new IMUAdvanced(new BufferingSerialPort(57600));
            if(nav6 != null) break;
        } catch (VisaException e) {
            if (++count == maxTries)
            {
                e.printStackTrace();
                break;
            }
            Timer.delay(.01);
        }
    }
    
    LiveWindow.addSensor("Drivetrain", "Gyro", nav6);
}
 
开发者ID:246overclocked,项目名称:rover,代码行数:27,代码来源:Drivetrain.java

示例4: Autonomous1

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public Autonomous1() {
    System.out.println("Auton");
    addParallel(new SetShooter(RobotMap.preset1), 5.0);
    addSequential(new ChangeElevation(true), 5.0);
    addParallel(new SetShooter(RobotMap.preset1));
    addSequential(new ShooterReady());
    addParallel(new SetShooter(RobotMap.preset1));
    addSequential(new KickHopper());
    addParallel(new SetShooter(RobotMap.preset1));
    addSequential(new ShooterReady());
    addParallel(new SetShooter(RobotMap.preset1));
    addSequential(new KickHopper());
    addParallel(new SetShooter(RobotMap.preset1));
    addSequential(new ShooterReady());
    addParallel(new SetShooter(RobotMap.preset1));
    addSequential(new KickHopper());
    addSequential(new SetShooter(0.0), 1.0);
}
 
开发者ID:Team3266,项目名称:legacy,代码行数:19,代码来源:Autonomous1.java

示例5: target

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public boolean target() {
    gyro.reset();
    double leftValue = limit((getGyroAngle()-aimRotation)*-RobotMap.rotationKp);
    double rightValue = limit((getGyroAngle()-aimRotation)*RobotMap.rotationKp);
    
    if (leftValue<0) drive.tankDrive(-2.0+leftValue, 2.0+rightValue);
    else drive.tankDrive(2.0+leftValue, -2.0+rightValue);
    
    if((getGyroAngle()>=-0.5 && getGyroAngle()<=0.5)) {
        double checkRotation = getImage();
        if ((getGyroAngle()-checkRotation>=-0.5) && (getGyroAngle()-checkRotation<=0.5)) {
            drive.drive(0.0, 0.0);
            return true;
        } else return false;
    } else return false;
}
 
开发者ID:Team3266,项目名称:legacy,代码行数:17,代码来源:Drivetrain.java

示例6: execute

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void execute() {
        
//        for (int i = 0; i < 8; i++){
//            
//            switch(i){
//                
//                case 1:
//                   
//            }
//        }
        
        RobotMap.shifter_2.set(!RobotMap.shifter.get());
        RobotMap.powerTakeoff_2.set(!RobotMap.powerTakeoff.get());
        RobotMap.frontPusherFirst_2.set(!RobotMap.frontPusherFirst.get());
        RobotMap.frontPusherSecond_2.set(!RobotMap.frontPusherSecond.get());
        RobotMap.rearPusher_2.set(!RobotMap.rearPusher.get());
        RobotMap.popper_2.set(!RobotMap.popper.get());
        RobotMap.popper2_2.set(!RobotMap.popper2.get());
        
        
    }
 
开发者ID:jdrusso,项目名称:ScraperBike2013,代码行数:22,代码来源:UpdateSolenoidModule.java

示例7: execute

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void execute() {
        
        this.determineSetpoint();
        
        if (lastAngle != RobotMap.desiredShooterAngle) {
            
            VerticalTurretAxis.resetGyro();      
            lastAngle = RobotMap.desiredShooterAngle;
        }
        
//        if (RobotMap.desiredShooterAngle != 0.0)    {
//            
//            VerticalTurretAxis.getGyro();
//            this.setSetpoint(RobotMap.desiredShooterAngle);
//            //VerticalTurretAxis = RobotMap.desiredShooterAngle;
//        }
//        
//        if (Math.abs (RobotMap.desiredShooterAngle - VerticalTurretAxis.readGyroDegress()) < 0.5) {
//            RobotMap.desiredShooterAngle = 0.0;
//        }
        
    }
 
开发者ID:jdrusso,项目名称:ScraperBike2013,代码行数:23,代码来源:ShooterElevationPID.java

示例8: ShooterMotorControl

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public ShooterMotorControl() {
    super("ShooterControl", Kp, Ki, Kd);
    Encoder topEncoder = new Encoder(RobotMap.topEncoderChannelA, RobotMap.topEncoderChannelB);
    Encoder bottomEncoder = new Encoder(RobotMap.bottomEncoderChannelA, RobotMap.bottomEncoderChannelB);
            
    try {
                    shooterJagTop = new CANJaguar(RobotMap.shooterJagTopID);
                    shooterJagBottom = new CANJaguar(RobotMap.shooterJagBottomID);
    } catch (CANTimeoutException e) {
        e.printStackTrace();
    }
    // Use these to get going:
    // setSetpoint() -  Sets where the PID controller should move the system
    //                  to
    // enable() - Enables the PID controller.
    enable();
}
 
开发者ID:DECABotz-3186,项目名称:frc-3186,代码行数:18,代码来源:ShooterMotorControl.java

示例9: initialize

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void initialize() {
    counter++;
    delayTimer = RobotMap.ShooterDelayTimer;
    delayTimer.start();
    display.println(DriverStationLCD.Line.kUser2, 1, "Pass command " + counter + "                    ");
    display.updateLCD();
    
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:9,代码来源:Pass.java

示例10: execute

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void execute() {
    theDriveTrain.drive(RobotMap.AutonomousSpeed);
    if (time.get() > 1.00) {
        timesup = true;
    }

}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:8,代码来源:AutoDriveForward.java

示例11: initialize

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void initialize() {
    counter++;
    delayTimer = RobotMap.ShooterDelayTimer;
    delayTimer.start();
    //TODO: use roller subsystem to lower the roller.
    display.println(DriverStationLCD.Line.kUser2, 1, "lauch command " + counter + "                  ");
    display.updateLCD();
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:9,代码来源:Launch.java

示例12: launch

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public void launch() {
    if (launcherSafetySwitch.get() == RobotMap.SafetoFire) {
        launcherLeft.set(RobotMap.LaunchSolenoidValue);
        launcherRight.set(RobotMap.LaunchSolenoidValue);
    } else if (launcherSafetySwitch.get() != RobotMap.SafetoFire) {
        launcherLeft.set(!RobotMap.LaunchSolenoidValue);
        launcherRight.set(!RobotMap.LaunchSolenoidValue);
    }
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:10,代码来源:Launcher.java

示例13: pass

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public void pass() {
    if (launcherSafetySwitch.get() == RobotMap.SafetoFire) {
        launcherLeft.set(RobotMap.LaunchSolenoidValue);
        launcherRight.set(!RobotMap.LaunchSolenoidValue);
    } else if (launcherSafetySwitch.get() != RobotMap.SafetoFire) {
        launcherLeft.set(!RobotMap.LaunchSolenoidValue);
        launcherRight.set(!RobotMap.LaunchSolenoidValue);
    }
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:10,代码来源:Launcher.java

示例14: shiftLowGear

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
/**
 *
 */
public void shiftLowGear() {
    GShiftSolUp.set(!RobotMap.DriveTrainLowGearSolenoidValue);
    GShiftSolDown.set(RobotMap.DriveTrainLowGearSolenoidValue);
    GShiftSolUp.set(false);
    GShiftSolDown.set(true);
    display.println(Line.kUser1, 1, "Into Low Gear ");
    display.updateLCD();
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:12,代码来源:DriveTrain.java

示例15: shiftHighGear

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
/**
 *
 */
public void shiftHighGear() {
    GShiftSolUp.set(!RobotMap.DriveTrainLowGearSolenoidValue);
    GShiftSolDown.set(RobotMap.DriveTrainLowGearSolenoidValue);
    GShiftSolUp.set(true);
    GShiftSolDown.set(false);

    display.println(Line.kUser1, 1, "Into High Gear ");
    display.updateLCD();
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:13,代码来源:DriveTrain.java


注:本文中的edu.wpi.first.wpilibj.templates.RobotMap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。