Skip to content
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

Merged
merged 11 commits into from
Mar 14, 2024
Merged

Belleville competition #40

merged 11 commits into from
Mar 14, 2024

Conversation

team6101
Copy link
Collaborator

@team6101 team6101 commented Mar 11, 2024

# 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

  • All the PR checks are passing (you see the green checkmark)
  • I have written comments on the PR where reviewers may have questions

Once you have the PR ready for review, request reviewers from the upper-right of the screen with the cog on the reviewers section.

Copy link
Collaborator Author

@team6101 team6101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Comment on lines +143 to +164
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;
}
}
);
Copy link
Collaborator Author

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.

Comment on lines +177 to +178
driveLeftParent.setInverted(false);
driveRightParent.setInverted(true);
Copy link
Collaborator Author

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.

Comment on lines -186 to -187
InputtedCoDriverControls.setCoDriverController(coDriverController);
InputtedDriverControls.setDriverController(driverController);
Copy link
Collaborator Author

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.

Comment on lines +284 to +289
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));
}
Copy link
Collaborator Author

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.

Comment on lines 72 to 87
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");
}
}
Copy link
Collaborator Author

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

Comment on lines +1 to +19
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() {}
}
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

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.

Comment on lines +177 to +180
public default CANSparkMax asCANSparkMax() {
return null;
}

Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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.

@team6101 team6101 merged commit 895c381 into main Mar 14, 2024
2 checks passed
@team6101 team6101 deleted the belleville-competition branch March 14, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants