• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RobotMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Catapult

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public Catapult() {
    try {
        //creates the motors
        Arm2 = new CANJaguar(RobotMap.CATAPULT_MOTOR);//, CANJaguar.ControlMode.kSpeed); 
    } catch (CANTimeoutException ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:9,代码来源:Catapult.java


示例17: Arm

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public Arm(){ 
    try {
        //creates the motors
        arm = new CANJaguar(RobotMap.ARM_MOTOR);//, CANJaguar.ControlMode.kSpeed);    
        
    } catch(CANTimeoutException ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:10,代码来源:Arm.java


示例18: isOverRotated

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public boolean isOverRotated()
{
    return Math.abs(frontModule.getModuleAngle()) > RobotMap.MAX_MODULE_ANGLE 
            || Math.abs(leftModule.getModuleAngle()) > RobotMap.MAX_MODULE_ANGLE 
            || Math.abs(backModule.getModuleAngle()) > RobotMap.MAX_MODULE_ANGLE 
            || Math.abs(rightModule.getModuleAngle()) > RobotMap.MAX_MODULE_ANGLE;
}
 
开发者ID:246overclocked,项目名称:rover,代码行数:8,代码来源:Drivetrain.java


示例19: execute

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void execute() {
    
    switch(state) {
        
        case 0:
            startTime = System.currentTimeMillis();
            hopper.set(true);
            state = 1;
            break;
        
        case 1: //On
            if(startTime+RobotMap.hopperKickLength*1000<=System.currentTimeMillis()) state = 2;
            break;
            
        case 2:
            startTime = System.currentTimeMillis();
            hopper.set(false);
            state = 3;
            break;
            
        case 3: //Off
            if(startTime+RobotMap.hopperKickReturnLength*1000<=System.currentTimeMillis()) state = 4;
            break;
            
        case 4: //Check
            if(oi.gunStick.getRawButton(RobotMap.hopperKickerButton)) state = 0;
            break;
    }
}
 
开发者ID:Team3266,项目名称:legacy,代码行数:30,代码来源:UserHopper.java


示例20: Shooter

import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public Shooter() {
    spinner = new Victor(RobotMap.spinnerVictor);
    
    spinnerEncoder = new Encoder(RobotMap.spinnerEncoderA, RobotMap.spinnerEncoderB);
    spinnerEncoder.setDistancePerPulse(-RobotMap.spinnerEncoderDistancePerPulse);
    
    pid = new PIDController(RobotMap.spinnerKp, RobotMap.spinnerKi, RobotMap.spinnerKd, this, this);
    //pid.setPercentTolerance(0.5);
}
 
开发者ID:Team3266,项目名称:legacy,代码行数:10,代码来源:Shooter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OffsetRequest类代码示例发布时间:2022-05-21
下一篇:
Java SettingsDecrypter类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap