Two comments. My best guess is that you need a sleep() or wait() or whatever the java equivalent is in the body of your while(isOperatorControl()) loop. If the brackets in your post match your robot code, then your launcher code will probably never get run, or will only get run before you disable the robot.
Code:
public void operatorControl() {
drive.setSafetyEnabled(true);
while (isOperatorControl()) <-- as long as you're in operator control, your robot will be in this loop. It should be responsive to your joysticks though. You may want to put a wait(0.001) call in (or whatever the java equivalent is) because this thread may be monopolizing the cRio CPU
{
drive.tankDrive(leftStick, rightStick);
}
drive.setSafetyEnabled(true);
drive.tankDrive(leftStick, rightStick); <-- this will only get called once, since you're not in a loop at the time you call it.
double z = leftStick.getZ();
while(constant = true) <-- if this is java or c++, you need to do constant == true. As this stands, you're assigning true to constant, and then testing if it is true, which means this loop will never end
{
if (z > 0.5)
{
launcher.set(LAUNCH_CONSTANT * 2);
launcherOpposite.set(LAUNCH_CONSTANT * -2);
}
else
{
launcher.set(LAUNCH_CONSTANT);
launcherOpposite.set(LAUNCH_CONSTANT * -1);
}
}
if (rightStick.getRawButton(3)) arm.set(0.5);
else
arm.set(0);
{
if (rightStick.getRawButton(2))
{
arm.set(-0.5);
}
else
arm.set(0);
}
if (rightStick.getRawButton(1))
{
claw.set(1);
}
else
claw.set(0);
}
}
}
Another thing: Our robot was non-responsive yesterday - it turned out we had a gyro in a non-accumulator port, and using the gyro was causing the robot to crash.