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


Java CANTimeoutException.printStackTrace方法代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.can.CANTimeoutException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java CANTimeoutException.printStackTrace方法的具体用法?Java CANTimeoutException.printStackTrace怎么用?Java CANTimeoutException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.wpi.first.wpilibj.can.CANTimeoutException的用法示例。


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

示例1: RoboDrive

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的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

示例2: operatorControl

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
/**
 * This function is called once each time the robot enters operator control.
 */
public void operatorControl() 
{
    while(isOperatorControl() && isEnabled())
    {
        //Tank stuff
        Drive.drive_tank(driver_left_joystick.getY(), driver_right_joystick.getY());
        System.out.println(Drive.get_front_left());
        try
        {
            front_left_jaguar.setX(Drive.get_front_left());
            back_left_jaguar.setX(Drive.get_back_left());
            back_right_jaguar.setX(Drive.get_back_right());
            front_right_jaguar.setX(Drive.get_front_right());
        }
        catch (CANTimeoutException ex)
        {
            ex.printStackTrace();
        }
        //todo: MECANUM
    }
}
 
开发者ID:1504,项目名称:robot2015preseason,代码行数:25,代码来源:robot2015preseason.java

示例3: goForwardNormal

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void goForwardNormal (double inches)
{
    try {
        double ticks = 0;
        cfgNormalMode(leftMotor);
        cfgNormalMode(rightMotor);
        ticks = leftMotor.getPosition() + 2.0;
        System.out.println("Starting Position: " + leftMotor.getPosition());
        while(leftMotor.getPosition() < ticks && isEnabled())
        {
            drive.arcadeDrive(0.5, 0.0);
            System.out.println(leftMotor.getPosition());
        }
    } 
    catch (CANTimeoutException ex)
    {
        ex.printStackTrace();
    }
    drive.arcadeDrive(0.0,0.0);
    
}
 
开发者ID:DevilTech,项目名称:UltimateAscentCode,代码行数:22,代码来源:RobotTemplate.java

示例4: ShooterMotorControl

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的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

示例5: goForward

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void goForward(double inches)
{
    try {

        cfgPosMode(leftMotor);
        cfgPosMode(rightMotor);
        leftMotor.setX(-10);
        rightMotor.setX(10);
        while(isEnabled())
        {
            System.out.println(leftMotor.getPosition());

        }
        leftMotor.setX(0);
        rightMotor.setX(0);
        cfgNormalMode(leftMotor);
        cfgNormalMode(rightMotor);
        
    } 
    catch (CANTimeoutException ex) 
    {
        ex.printStackTrace();
    }
}
 
开发者ID:DevilTech,项目名称:UltimateAscentEnhancedButtonLogic,代码行数:25,代码来源:RobotTemplate.java

示例6: calculate

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void calculate()
{
    if(!isEnabled){ return; }
    
    try
    {
        //If speed is < desired speed, then output = 1.0
        //If speed is anything else, output = 0.0 (STOP)
        if(motor.getSpeed() >= targetSpeed){
            motor.setX(0.0);
        } else {
            motor.setX(reversed ? -1.0 : 1.0);
        }
    }
    catch(CANTimeoutException ex)
    {
        ex.printStackTrace();
    }
}
 
开发者ID:FRC79,项目名称:CK_16_Java,代码行数:20,代码来源:BangBangController.java

示例7: disabled

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void disabled()
{
    
    try 
    {
        leftMotor.setX(0);
        rightMotor.setX(0);
        shooter.stop();   //  JAG CHANGE
        /*while(isDisabled())
        {
            System.out.println("Partial Sensor: " + climb.part.get() + " Top Sensor: " + climb.max.get());
           
        }*/
    }
    catch (CANTimeoutException ex) 
    {
        ex.printStackTrace();
    }
}
 
开发者ID:DevilTech,项目名称:UltimateAscentCode,代码行数:20,代码来源:RobotTemplate.java

示例8: robotInit

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    joystick = new Joystick(JOYSTICK_PORT);
    try {
        rightFront = new CANJaguar(JAG_MOTOR, CANJaguar.ControlMode.kSpeed);
        configSpeedControl(rightFront);
    } catch (CANTimeoutException ex) {
        ex.printStackTrace();
        //System.exit(-1);
    }
}
 
开发者ID:Team-4153,项目名称:IterativeEncoderTest,代码行数:15,代码来源:RobotMain.java

示例9: teleopPeriodic

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
/**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        try {
//            rightFront.setX(joystick.getRawAxis(1)*100);
            if(joystick.getRawButton(1)){
                rightFront.setX(60);
            }else if(joystick.getRawButton(2)){
                rightFront.setX(40);
            }
            System.err.println("Encoder: " + rightFront.getSpeed());
        } catch (CANTimeoutException ex) {
            ex.printStackTrace();
        }
    }
 
开发者ID:Team-4153,项目名称:IterativeEncoderTest,代码行数:17,代码来源:RobotMain.java

示例10: Catapult

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的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

示例11: WindUp

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void WindUp() {
        try {
            Arm2.setX(-1);
//            try {
//                Thread.sleep(2000);
//            } catch (InterruptedException ex) {
//                ex.printStackTrace();
//            }
            Arm2.setX(-.5);
        } catch (CANTimeoutException ex) {
            ex.printStackTrace();
        }
    }
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:14,代码来源:Catapult.java

示例12: UnWind

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void UnWind() {
        try {
            Arm2.setX(1);
//            try {
//                Thread.sleep(100);
//            } catch (InterruptedException ex) {
//                ex.printStackTrace();
//            }            

        } catch (CANTimeoutException ex) {
            ex.printStackTrace();
        }
    }
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:14,代码来源:Catapult.java

示例13: setMotor

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void setMotor(double purple) {
    try {
        Arm2.setX(purple);
    } catch (CANTimeoutException ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:8,代码来源:Catapult.java

示例14: Stop

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void Stop() {
    try {
        Arm2.setX(0);
    } catch (CANTimeoutException ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:8,代码来源:Catapult.java

示例15: get

import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public boolean get() {
    try {
        return Arm2.getReverseLimitOK();
    } catch (CANTimeoutException ex) {
        ex.printStackTrace();
    }
    return false;
}
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:9,代码来源:Catapult.java


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