本文整理汇总了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();
}
}
示例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
}
}
示例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);
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例13: setMotor
import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void setMotor(double purple) {
try {
Arm2.setX(purple);
} catch (CANTimeoutException ex) {
ex.printStackTrace();
}
}
示例14: Stop
import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public void Stop() {
try {
Arm2.setX(0);
} catch (CANTimeoutException ex) {
ex.printStackTrace();
}
}
示例15: get
import edu.wpi.first.wpilibj.can.CANTimeoutException; //导入方法依赖的package包/类
public boolean get() {
try {
return Arm2.getReverseLimitOK();
} catch (CANTimeoutException ex) {
ex.printStackTrace();
}
return false;
}