-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Belleville competition #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
SmartDashboard.putData( | ||
"SWITCH CONTROLLERS", | ||
new Command() { | ||
{ | ||
setName("Execute"); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
System.out.println("We have switched thy controllers"); | ||
int driverPort = driverController.getPort(); | ||
int coDriverPort = coDriverController.getPort(); | ||
driverController = new XboxController(coDriverPort); | ||
coDriverController = new XboxController(driverPort); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return true; | ||
} | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a clickable button to the SmartDashboard.
driveLeftParent.setInverted(false); | ||
driveRightParent.setInverted(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We realized that the xbox stick forward is actually -1, so we inversed the motors and removed all the * -1's in our code.
InputtedCoDriverControls.setCoDriverController(coDriverController); | ||
InputtedDriverControls.setDriverController(driverController); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now get the controllers statically from the Robot class instead of our previous silly method.
AutonRoutes.setupCorrectAutonPaths(); | ||
ArrayDeque<AutonAction> route = new ArrayDeque<>(autonRouteChooser.getSelected()); | ||
double delayAmount = SmartDashboard.getNumber("Auton Delay (sec)", 0.0); | ||
if (delayAmount > 0) { | ||
route.addFirst(new AutonWait(delayAmount)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds a way for drivers to specify a wait period before auton starts in the SmartDashboard.
if (DriverStation.getAlliance().get() == Alliance.Red) { | ||
BACKUP_TURN_BACKUP = RED_BACKUP_TURN_BACKUP; | ||
MESS_UP_CENTER_RINGS_FROM_AMP_SIDE = MESS_UP_CENTER_RINGS_TURN_LEFT; | ||
MESS_UP_CENTER_RINGS_FROM_TERMINAL_SIDE = MESS_UP_CENTER_RINGS_TURN_RIGHT; | ||
SHOOT_ROTATE_BACK_UP_FROM_TERMINAL_SIDE = SHOOT_ROTATE_BACK_UP_FROM_TERMINAL_SIDE_RED; | ||
SHOOT_ROTATE_BACK_UP_FROM_AMP_SIDE = SHOOT_ROTATE_BACK_UP_FROM_AMP_SIDE_RED; | ||
System.out.println("Configuring auton routes for RED team"); | ||
} else { | ||
BACKUP_TURN_BACKUP = BLUE_BACKUP_TURN_BACKUP; | ||
MESS_UP_CENTER_RINGS_FROM_AMP_SIDE = MESS_UP_CENTER_RINGS_TURN_RIGHT; | ||
MESS_UP_CENTER_RINGS_FROM_TERMINAL_SIDE = MESS_UP_CENTER_RINGS_TURN_LEFT; | ||
SHOOT_ROTATE_BACK_UP_FROM_TERMINAL_SIDE = SHOOT_ROTATE_BACK_UP_FROM_TERMINAL_SIDE_BLUE; | ||
SHOOT_ROTATE_BACK_UP_FROM_AMP_SIDE = SHOOT_ROTATE_BACK_UP_FROM_AMP_SIDE_BLUE; | ||
System.out.println("Configuring auton routes for BLUE team"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to turn different directions based on whether we are blue or red so we need to adjust the auton routes accordingly
package frc.robot.auton; | ||
|
||
import frc.robot.QuickActions; | ||
|
||
public class MovePercentOutput extends AutonAction { | ||
|
||
@Override | ||
public boolean isDone() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void initiate() { | ||
QuickActions.setDriveMotors(0.25); | ||
} | ||
|
||
@Override | ||
public void shutdown() {} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably isn't needed anymore, this was a quick and dirty way to just move backwards in auton ,without relying on PID's.
() -> Robot.getGyroscope().getAngle() + relativeTurnDegree, | ||
Robot.getGyroscope().getAngle() + relativeTurnDegree, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing the setpoint to change every frame, which made this impossible to finish.
public default CANSparkMax asCANSparkMax() { | ||
return null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting the CanSparkMax object is helpful for doing Spark specific things.
@@ -171,6 +174,10 @@ public default void setPID(Gains gains) { | |||
*/ | |||
public boolean getReverseLimit(); | |||
|
|||
public default CANSparkMax asCANSparkMax() { | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return null by default, as should only return something if it is a Spark Motor Controller.
# Description
look at the comments. There are too many changes to be generalized here, other than saying that they are the changes that happened during our first competition.
Checklist before marking this PR as ready for review
Once you have the PR ready for review, request reviewers from the upper-right of the screen with the cog on the reviewers section.