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

Java DriveTrain类代码示例

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

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



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

示例1: init

import edu.wpi.first.wpilibj.templates.subsystems.DriveTrain; //导入依赖的package包/类
public static void init() {
    // This MUST be here. If the OI creates Commands (which it very likely
    // will), constructing it during the construction of CommandBase (from
    // which commands extend), subsystems are not guaranteed to be
    // yet. Thus, their requires() statements may grab null pointers. Bad
    // news. Don't move it.
    
    driveTrain = new DriveTrain();
    shooter = new Shooter();
    vision = new Vision();

    pitch = new Pitch();
    trigger = new Trigger();
    loader1 = new Loader1();
    loader2 = new Loader2();

    //leave oi at the bottom and apart from the other initialized things
    //if it is initialized before the subsytems, it throws some null pointer exceptions
    //those are not fun
    //please leave it here
    oi = new OI();
    // Show what command your subsystem is running on the SmartDashboard
    SmartDashboard.putData(exampleSubsystem);
}
 
开发者ID:tglem89,项目名称:2013-code-v2,代码行数:25,代码来源:CommandBase.java


示例2: runSmartDashboard

import edu.wpi.first.wpilibj.templates.subsystems.DriveTrain; //导入依赖的package包/类
/**
 * SmartDashboard is used to send diagnostic information back to the
 * DriverStation here.
 */
private static void runSmartDashboard() {
    SmartDashboard.putNumber("Shooter Angle: ", Angle.angleEncoder.getDistance()); //Should be very accurate.  
    SmartDashboard.putNumber("Shooter RPM: ", Shooter.currentRPM); //line plot :D
    SmartDashboard.putBoolean("RPM Status: ", Shooter.shooterStatus()); //Big green/red square on the smartdashboard. 
    SmartDashboard.putNumber("Shooter PWM Value: ", Shooter.shooterPWM1.getSpeed()); //Diagnostic information.  Not really important to the driver
    SmartDashboard.putBoolean("Auto Limit", autonomousSwitch.get());
    SmartDashboard.putBoolean("Front Limit", DriveTrain.frontLimit.get()); //Not really used.
    SmartDashboard.putNumber("Timer", timer.get());
    SmartDashboard.putNumber("Target Angle", Vision.calculateAngle());
    if (initEmergencyConstantValue){
    SmartDashboard.putNumber("EMERGENCY CORRECTION VALUE", Vision.emergencyCorrectionValue);
    initEmergencyConstantValue=false;
    }
    
}
 
开发者ID:PeterMitrano,项目名称:293-2013,代码行数:20,代码来源:Spike.java


示例3: initialize

import edu.wpi.first.wpilibj.templates.subsystems.DriveTrain; //导入依赖的package包/类
protected void initialize() {
    gyro.reset();
    DriveTrain.polarMode = !(DriveTrain.polarMode);
    if(DriveTrain.polarMode == true){
        SmartDashboard.putString("polarMode", "Polar Mode");
    }else{
        SmartDashboard.putString("polarMode", "Field Oriented");
    }
}
 
开发者ID:frc3946,项目名称:MecanumDrivetrain,代码行数:10,代码来源:ToggleDrive.java


示例4: StandardDrive

import edu.wpi.first.wpilibj.templates.subsystems.DriveTrain; //导入依赖的package包/类
/**
 *
 * @param d
 * @param j
 */
public StandardDrive(RobotDrive d, Joystick j){
    super("StandardDrive");
    DriveTrain = ScraperBike.getDriveTrain(); 
    //gyro1 = DriveTrain.getGyro1();
    requires(DriveTrain);
    Joystick = j;
    drive = d;    
}
 
开发者ID:jdrusso,项目名称:ScraperBike2013,代码行数:14,代码来源:StandardDrive.java


示例5: execute

import edu.wpi.first.wpilibj.templates.subsystems.DriveTrain; //导入依赖的package包/类
protected void execute() {
//        DriveTrain.getCommandLog().setInputs("" + gyro1.getAngle());
//        DriveTrain.setMetaCommandOutputs();
        //drive.arcadeDrive(Joystick1);
//TODO: if pause works, uncomment.
//        if (RobotMap.isJoystickEnabled()) {
            DriveTrain.powerDriveTrain();
            
            DriveTrain.arcadeDrive(Joystick);
            
//        }
    
    }
 
开发者ID:jdrusso,项目名称:ScraperBike2013,代码行数:14,代码来源:StandardDrive.java


示例6: autonomousPeriodic

import edu.wpi.first.wpilibj.templates.subsystems.DriveTrain; //导入依赖的package包/类
/**
 * Code here loops every 20 milliseconds during the autonomous period. While
 * loops should not be used.
 */
public void autonomousPeriodic() {
    Shooter.calculateRPM(); //Constantly calculates the rpm
    Shooter.runShooter(); //Adjusts the shooter PWM value accordly depending on the RPM
    if (timer.get() < 8) { //Fire Frisbees for the first 8 seconds
        DriveTrain.tankDrive(0, 0);
        //Gets current robot location from switch on robot
        if (autonomousSwitch.get() == false) {
            Angle.setAngle(centerShotAngle);
        } else {
            Angle.setAngle(sideShotAngle);
        }
        //When the angle is set, fire the Frisbees
        if (AutoCenter.isAutoAimDone() == true) {
            readyToFire = true;
        } else {
            readyToFire = false;
        }
        Shooter.fireShooter(readyToFire);
    } else if (timer.get() < 8.5) { //Back up the robot after 8 seconds for 0.5 seconds
        DriveTrain.tankDrive(0.7, 0.7);
    } else if (timer.get() < 10.5) { //Rotate the robot after 8.5 seconds for 2 seconds
        DriveTrain.rotateDrive(0.5);
    } else { //Stop the robot after 10.5 seconds
        DriveTrain.tankDrive(0, 0);
        LCD.println(DriverStationLCD.Line.kUser6, 1, ",");
    }

    //For testing purposes
    if (timer.get() > 15) { //Resets the timer every 15 seconds
        timer.reset();
    }

    runSmartDashboard(); //Constantly sends diagnostic information from the robot to the DriverStation
    LCD.updateLCD(); //Updates LCD so that we have feedback on what is happening.  Only one is needed per periodic loop.  
}
 
开发者ID:PeterMitrano,项目名称:293-2013,代码行数:40,代码来源:Spike.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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