public static final int ARCADE = 1;
public static final int DRIVE_TYPE = TANK;
+ // Limits changes in speed during joystick driving
+ public static final double kADJUST = 8;
+
// Drivetrain Motor related ports
public static final int DRIVE_FRONT_LEFT = 1;
public static final int DRIVE_REAR_LEFT = 2;
public static final int OUT = -1;
// for roller
- public static final double INTAKE_SPEED = 0.5;
- public static final double OUTPUT_SPEED = -0.5;
+ public static final double INTAKE_SPEED = 0.7;
+ public static final double OUTPUT_SPEED = -0.7;
}
}
package org.usfirst.frc.team3501.robot;
import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear;
-import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm;
-import org.usfirst.frc.team3501.robot.commands.shooter.ResetCatapult;
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
import org.usfirst.frc.team3501.robot.subsystems.Shooter;
@Override
public void teleopInit() {
Scheduler.getInstance().add(new SetHighGear());
- Scheduler.getInstance().add(new ResetCatapult());
- Scheduler.getInstance().add(new MoveIntakeArm(Constants.IntakeArm.EXTEND));
}
@Override
// Called just before this Command runs the first time
@Override
protected void initialize() {
- Robot.driveTrain.switchGear();
+ Robot.driveTrain.toggleFlipped();
}
// Called repeatedly when this Command is scheduled to run
int type = Constants.DriveTrain.DRIVE_TYPE;
double k = (isFlipped() ? -1 : 1);
if (type == Constants.DriveTrain.TANK) {
+ double leftSpeed = (-frontLeft.get() + -rearLeft.get()) / 2;
+ double rightSpeed = (-frontRight.get() + -rearRight.get()) / 2;
+ left = ((Constants.DriveTrain.kADJUST - 1) * leftSpeed + left)
+ / Constants.DriveTrain.kADJUST;
+ right = ((Constants.DriveTrain.kADJUST - 1) * rightSpeed + right)
+ / Constants.DriveTrain.kADJUST;
robotDrive.tankDrive(-left * k, -right * k);
} else if (type == Constants.DriveTrain.ARCADE) {
+ double speed = (-frontLeft.get() + -rearLeft.get() + -frontRight.get() + -rearRight
+ .get()) / 2;
+ left = ((Constants.DriveTrain.kADJUST - 1) * speed + left)
+ / Constants.DriveTrain.kADJUST;
robotDrive.arcadeDrive(left * k, right);
}
}