Today was our first meet of the season at Gross Catholic. We ran into some major issues.
-
Robot would not move when in driver control without being plugged into field control
-
Our auton wouldn’t run properly when connected to the field but it was fine when connected to a comp switch.
-
When running skills, we found an error on the screen after plugging in which stated that “incorrect type VexNet3” or something along those lines. When we switched the radio signal type to bluetooth, the screen would say we were good to go but our bot would still not move.
I did some looking here on the forum earlier and I found that if you put (!Competition.isEnabled() && (Competition.isCompetitionSwitch())) || Competition.isFieldControl()
into the conditional statement in the while loop, problem 2 was resolved. The side effect of this fix was that when trying to even drive our bot with or without a comp switch, nothing would move. With the same code, Our autons and driving worked perfectly when connected to the field controller. Still, nothing would work when connected to the skills field controller.
Im at the point where im probably going to throw my bot off a bridge in the near future so if anyone on this forum has some insight to lend me, my robot and I would greatly appreciate it, Thanks!!
P.S. heres our code
void usercontrol(void) {
//disable forward pid loops
enableSForwardPID = false;
enableMForwardPID = false;
enableLForwardPID = false;
//disable reverse pid loops
enableSReversePID = false;
enableMReversePID = false;
enableLReversePID = false;
//disable left turn pid loops
enableTurnLeft90PID = false;
enableTurnLeft180PID = false;
//disable right turn pid loops
enableTurnRight90PID = false;
enableTurnRight180PID = false;
int countF = 0;
int PcountF = 0;
while ((!Competition.isEnabled() && (Competition.isCompetitionSwitch())) || Competition.isFieldControl()) {
//Drive
//---------------------------------------------------------------------------//
int FLDriveSpeed = ControllerM.Axis3.position();
int BLDriveSpeed = ControllerM.Axis3.position();
int FRDriveSpeed = ControllerM.Axis2.position();
int BRDriveSpeed = ControllerM.Axis2.position();
FLDrive.setStopping(coast);
BLDrive.setStopping(coast);
FRDrive.setStopping(coast);
BRDrive.setStopping(coast);
FLDrive.setVelocity(FLDriveSpeed, percent);
BLDrive.setVelocity(BLDriveSpeed, percent);
FRDrive.setVelocity(FRDriveSpeed, percent);
BRDrive.setVelocity(BRDriveSpeed, percent);
FLDrive.spin(forward);
BLDrive.spin(forward);
FRDrive.spin(forward);
BRDrive.spin(forward);
//---------------------------------------------------------------------------//
//Intake
//---------------------------------------------------------------------------//
if(ControllerM.ButtonL1.pressing()){
Intake.spin(forward, 127, volt);
}
else if(ControllerM.ButtonL2.pressing()){
Intake.spin(reverse, 127, volt);
}
else{
Intake.stop(coast);
}
//---------------------------------------------------------------------------//
//Flywheel
//---------------------------------------------------------------------------//
//Main controller high
//---------------------------------------------------------------------------//
if(ControllerM.ButtonY.pressing() && countF == 0){
Flywheel.spin(forward, 127, voltageUnits::volt);
waitUntil(!ControllerM.ButtonY.pressing());
countF = 1;
}
if(ControllerM.ButtonY.pressing() && countF == 1){
Flywheel.stop(coast);
waitUntil(!ControllerM.ButtonY.pressing());
countF = 0;
}
//---------------------------------------------------------------------------//
//Main controller low
//---------------------------------------------------------------------------//
if(ControllerM.ButtonX.pressing() && countF == 0){
Flywheel.spin(forward, 10.5 , voltageUnits::volt);
waitUntil(!ControllerM.ButtonX.pressing());
countF = 1;
}
if(ControllerM.ButtonX.pressing() && countF == 1){
Flywheel.stop(coast);
waitUntil(!ControllerM.ButtonX.pressing());
countF = 0;
}
//---------------------------------------------------------------------------//
//Partner controller high
//---------------------------------------------------------------------------//
if(ControllerP.ButtonR2.pressing() && PcountF == 0){
Flywheel.spin(forward, 127, voltageUnits::volt);
waitUntil(!ControllerP.ButtonR2.pressing());
PcountF = 1;
}
if(ControllerP.ButtonR2.pressing() && PcountF == 1){
Flywheel.stop(coast);
waitUntil(!ControllerP.ButtonR2.pressing());
PcountF = 0;
}
//---------------------------------------------------------------------------//
//Partner controller low
//---------------------------------------------------------------------------//
if(ControllerP.ButtonR1.pressing() && PcountF == 0){
Flywheel.spin(forward, 10.5, voltageUnits::volt);
waitUntil(!ControllerP.ButtonR1.pressing());
PcountF = 1;
}
if(ControllerP.ButtonR1.pressing() && PcountF == 1){
Flywheel.stop(coast);
waitUntil(!ControllerP.ButtonR1.pressing());
PcountF = 0;
}
//Indexer
//---------------------------------------------------------------------------//
if(ControllerM.ButtonR1.pressing()){
Indexer.set(true);
wait(120, msec);
Indexer.set(false);
waitUntil(!ControllerM.ButtonR1.pressing());
}
//---------------------------------------------------------------------------//
//Engame
//---------------------------------------------------------------------------//
if(ControllerP.ButtonL1.pressing() && (ControllerP.ButtonL2.pressing()) && (ControllerM.ButtonUp.pressing())){
Endgame.set(true);
}
wait(20, msec);
}
}