Skip to content

Added Auto Back and Shoot#142

Open
neelabhb-sudo wants to merge 2 commits intomainfrom
auto-back-and-shoot
Open

Added Auto Back and Shoot#142
neelabhb-sudo wants to merge 2 commits intomainfrom
auto-back-and-shoot

Conversation

@neelabhb-sudo
Copy link
Contributor

Added Auto_Further_Front 100 inches - than HUB_CENTER. Added a command for going backwards and shooting fuel plus a deadline using the .until function. Added this command as a Auton in robot container.

Added Auto_Further_Front 100 inches - than HUB_CENTER. Added a command for going backwards and shooting fuel. Added this command as a Auton in robot container.
this.autoOutpost = new AutoOutpost(robot, shootFuel);
this.autoEdgeIntake = new AutoEdgeIntake(robot);
this.collectFuelFromHub = new CollectFuelFromHub(robot);
this.hopperSensors = new HopperSensors();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't create a new HopperSensors. Instead use robot.getHopperSenors().

public final AutoOutpost autoOutpost;
public final AutoEdgeIntake autoEdgeIntake;
public final CollectFuelFromHub collectFuelFromHub;
public final HopperSensors hopperSensors;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need this field. Just use robot.getHopperSensors() instead.

shootFuel.shoot());
}

public Command moveBackwardAndShoot() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a Javadoc comment to this method.

public Command moveBackwardAndShoot() {
return Commands.sequence(
robot.getSwerveDrive().driveTo(FieldPositions.HUB_FURTHER_FRONT), shootFuel.shoot())
.until(() -> hopperSensors.isHopperEmpty());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't stop shooting even if the hopper is empty. We want to remove as many failure points as we can, and it's possible that no fuel could be blocking the sensor for a brief time.


public Command moveBackwardAndShoot() {
return Commands.sequence(
robot.getSwerveDrive().driveTo(FieldPositions.HUB_FURTHER_FRONT), shootFuel.shoot())
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Run AutoShoot in parallel to make the shooter aim at the hub
  • Make shootFuel.shoot() only run when the trigger returned by autoShoot.isReadyToShoot() outputs true (you can do this with shootFuel.shoot().onlyWhile(autoShoot::isReadyToShoot).repeatedly()).

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