Skip to content

Commit

Permalink
Revert "removed magic numbers, renamed commands"
Browse files Browse the repository at this point in the history
  • Loading branch information
qscgy authored Feb 22, 2017
1 parent 4c33353 commit fc86911
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class Intake2017 extends MappedSubsystem {
private DoubleSolenoid piston;
public boolean isIntaking;
public boolean intakeUp;
double fixedPctShoot, movingPctShoot, fixedPctPickup, movingPctPickup;

/**
* Creates a mapped subsystem and sets its map
Expand All @@ -29,10 +28,6 @@ public Intake2017(maps.org.usfirst.frc.team449.robot.mechanism.intake.Intake2017
this.actuatedVictor = new VictorSP(map.getActuatedVictor().getPort());
actuatedVictor.setInverted(map.getActuatedVictor().getInverted());
this.piston = new DoubleSolenoid(map.getPistonModuleNum(), map.getPiston().getForward(), map.getPiston().getReverse());
this.fixedPctPickup = map.getFixedPctPickup();
this.movingPctPickup = map.getMovingPctPickup();
this.fixedPctShoot = map.getFixedPctShoot();
this.movingPctShoot = map.getMovingPctShoot();
}

public void setFixedVictor(double speed) {
Expand All @@ -49,16 +44,6 @@ public void setPiston(DoubleSolenoid.Value value) {
intakeUp = (value == DoubleSolenoid.Value.kReverse);
}

public void pickupBalls(){
setFixedVictor(fixedPctPickup);
setActuatedVictor(movingPctPickup);
}

public void prepareToShoot(){
setFixedVictor(fixedPctShoot);
setActuatedVictor(movingPctShoot);
}

public void setIntaking(boolean isIntaking){
this.isIntaking = isIntaking;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.spin;

import maps.org.usfirst.frc.team449.robot.mechanism.intake.Intake2017Map;
import org.usfirst.frc.team449.robot.ReferencingCommand;
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.Intake2017;

/**
* Created by ryant on 2017-02-19.
* Sets the intake subsystem to the speed presets for intaking balls.
*/
public class SIDI extends ReferencingCommand {

Expand All @@ -19,7 +17,8 @@ public SIDI(Intake2017 intake) {

@Override
protected void initialize() {
intake.pickupBalls();
intake.setFixedVictor(-0.7);
intake.setActuatedVictor(1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public SIDS(Intake2017 intake) {

@Override
protected void initialize() {
intake.prepareToShoot();
intake.setFixedVictor(-0.3);
intake.setActuatedVictor(0);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SingleFlywheelShooter extends MappedSubsystem {
public boolean spinning;
private UnitlessCANTalonSRX talon;

public double throttle;
public double throttle=0.5;
/**
* Counts per revolution
*/
Expand Down Expand Up @@ -92,6 +92,7 @@ protected void initDefaultCommand() {
e.printStackTrace();
}
startTime = System.nanoTime();
// setDefaultCommand(new PIDTune(this));
System.out.println("Finished init default command");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
/**
* Created by ryant on 2017-02-18.
*/
public class IntakeBalls extends CommandGroup {
public IntakeBalls(SingleFlywheelShooter sfs, Intake2017 intake, FeederSubsystem feeder) {
public class LoadShooter extends CommandGroup {
public LoadShooter(SingleFlywheelShooter sfs, Intake2017 intake, FeederSubsystem feeder) {
requires(intake);
addParallel(new DecelerateFlywheel(sfs, 5));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.spin.SIDI;
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.spin.SIDS;
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.spin.StaticIntakeStop;
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.updown.IntakeDown;
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.updown.IntakeUp;
import org.usfirst.frc.team449.robot.mechanism.singleflywheelshooter.SingleFlywheelShooter;
import org.usfirst.frc.team449.robot.mechanism.singleflywheelshooter.commands.AccelerateFlywheel;
Expand All @@ -18,13 +17,13 @@
/**
* Created by ryant on 2017-02-18.
*/
public class PrepareToShoot extends CommandGroup {
public PrepareToShoot(SingleFlywheelShooter sfs, Intake2017 intake, FeederSubsystem feeder) {
public class RackShooter extends CommandGroup {
public RackShooter(SingleFlywheelShooter sfs, Intake2017 intake, FeederSubsystem feeder) {
requires(intake);

addParallel(new AccelerateFlywheel(sfs, 5));

addParallel(new IntakeDown(intake));
addParallel(new IntakeUp(intake));
addParallel(new SIDS(intake));

addParallel(new StopFeeder(feeder));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
import org.usfirst.frc.team449.robot.mechanism.climber.commands.StopClimbing;
import org.usfirst.frc.team449.robot.mechanism.feeder.commands.ToggleFeeder;
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.ToggleIntakeUpDown;
import org.usfirst.frc.team449.robot.mechanism.intake.Intake2017.commands.ToggleIntaking;
import org.usfirst.frc.team449.robot.mechanism.singleflywheelshooter.commands.ToggleFlywheel;
import org.usfirst.frc.team449.robot.mechanism.singleflywheelshooter.commands.ToggleShooter;
import org.usfirst.frc.team449.robot.mechanism.topcommands.shooter.FireShooter;
import org.usfirst.frc.team449.robot.mechanism.topcommands.shooter.IntakeBalls;
import org.usfirst.frc.team449.robot.mechanism.topcommands.shooter.PrepareToShoot;
import org.usfirst.frc.team449.robot.mechanism.topcommands.shooter.LoadShooter;
import org.usfirst.frc.team449.robot.mechanism.topcommands.shooter.RackShooter;
import org.usfirst.frc.team449.robot.oi.components.SmoothedThrottle;
import org.usfirst.frc.team449.robot.oi.components.Throttle;
import org.usfirst.frc.team449.robot.vision.commands.ChangeCam;
Expand Down Expand Up @@ -193,10 +195,10 @@ public void mapButtons() {
shoot.whenPressed(new ToggleShooter(Robot.singleFlywheelShooterSubsystem));
}
if (loadShooter != null) {
loadShooter.whenPressed(new IntakeBalls(Robot.singleFlywheelShooterSubsystem, Robot.intakeSubsystem, Robot.feederSubsystem));
loadShooter.whenPressed(new LoadShooter(Robot.singleFlywheelShooterSubsystem, Robot.intakeSubsystem, Robot.feederSubsystem));
}
if (rackShooter != null) {
rackShooter.whenPressed(new PrepareToShoot(Robot.singleFlywheelShooterSubsystem, Robot.intakeSubsystem, Robot.feederSubsystem));
rackShooter.whenPressed(new RackShooter(Robot.singleFlywheelShooterSubsystem, Robot.intakeSubsystem, Robot.feederSubsystem));
}
if (fireShooter != null) {
fireShooter.whenPressed(new FireShooter(Robot.singleFlywheelShooterSubsystem, Robot.intakeSubsystem, Robot.feederSubsystem));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ message Intake2017 {
required Motor actuated_victor = 3;
required DoubleSolenoid piston = 4;
required int32 pistonModuleNum = 5;
required double fixed_pct_pickup = 6;
required double moving_pct_pickup = 7;
required double fixed_pct_shoot = 8;
required double moving_pct_shoot = 9;
}
4 changes: 0 additions & 4 deletions src/main/resources/final_map.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ intake {
reverse: 4
}
pistonModuleNum: 15
fixed_pct_pickup: -0.7
moving_pct_pickup: 1
fixed_pct_shoot: -0.3
moving_pct_pickup: 0
}
camera {
server {
Expand Down

0 comments on commit fc86911

Please sign in to comment.