Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
21fc68b
Stuff
Mar 22, 2018
a2c9d79
Finished up rewriting, and configuring
Mar 22, 2018
df98988
THIS is the correct config
Mar 22, 2018
65372b6
Its all broken in every way
Mar 22, 2018
1df05d3
Change the move lift auto state to make it simpler and hopefully work
Mar 23, 2018
2cc9533
Control and hardware changes
Mar 23, 2018
9e42f05
Some changes that will either fix a lot or break even more.
Mar 24, 2018
ffba4b7
Morning Commit
Mar 24, 2018
4ac054e
Around noon-it works
Mar 24, 2018
05ced5a
Auto a bit safer hopefully
Mar 24, 2018
32bac1d
Point at which everything is good-4:30
Mar 24, 2018
733a375
End of day, everything ok.
Mar 24, 2018
2b1da8e
More power, does it in time?
Mar 24, 2018
7d29d7c
end of alliance selection
Mar 25, 2018
886e6a5
Auto Lift
Mar 25, 2018
c13d270
Added auto climb button
Mar 25, 2018
458f11b
Removed extraneous import
rafibaum Mar 26, 2018
2acb3d4
Merge pull request #41 from MontclairRobotics/comp-3/23
H1ppx Mar 26, 2018
c035932
Created AutoSwitch.java and helper default classes
Apr 10, 2018
b55fc1d
Completed AutoSwitch.fromMiddle(), awaiting testing
Apr 10, 2018
375a36c
AutoSwitch.java finished! Ready to test.
Apr 18, 2018
5d54d05
AutoSwitch.java declared in PowerUpRobot.
Apr 18, 2018
99046e8
Intake Working
Apr 18, 2018
17adf1f
Fix error
Apr 18, 2018
93acdb8
It runs on the robot again
Apr 19, 2018
cf56f94
Cleanup, re-enabled roational motor but with the right name
Apr 21, 2018
075b4e1
Deprecated unused files
Apr 21, 2018
3a4cf14
Don't want to do this
Apr 21, 2018
daa5801
Revert "Don't want to do this"
Apr 21, 2018
35a91cb
Merge branch 'josh-auto-switch' of https://github.com/MontclairRoboti…
Apr 21, 2018
cf9ae84
Merge branch 'cleanup' into josh-auto-switch
Apr 21, 2018
8eb0285
Merge Cleanup Branch and Josh Auto branch
Apr 21, 2018
5b04cc8
Build sucessful
Apr 21, 2018
8cd2886
Teleop Runs
Apr 21, 2018
130b52f
Before we fix the auto
Apr 26, 2018
b2fbcf8
Final Worlds code
Apr 28, 2018
d957f8b
Added limit switches to Target Motor (should have been here all along…
jackhymowitz May 2, 2018
8cd1b89
Updates to make it "Safer" for Petting Zoo; Revert after
May 8, 2018
d8580ce
Merge branch 'josh-auto-switch' of https://github.com/MontclairRoboti…
May 8, 2018
d2ffb5f
Update before petting zoo
May 12, 2018
eb4901f
Final petting zoo code...
May 12, 2018
d6ed2c1
power down after library
May 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/main/java/frc/team555/robot/Robot.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package frc.team555.robot;

import frc.team555.robot.core.PIDLoopTest;

import frc.team555.robot.core.PowerUpRobot;
import frc.team555.robot.core.PowerUpRobot2;
import frc.team555.robot.test.EncoderTestRobot;
import frc.team555.robot.test.TestRobot;
import frc.team555.robot.test.TestRobot2;
import frc.team555.robot.test.TestRobot3;

public class Robot extends EncoderTestRobot {
public class Robot extends PowerUpRobot {
}

77 changes: 77 additions & 0 deletions src/main/java/frc/team555/robot/auto/AutoClimbSequence.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package frc.team555.robot.auto;

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import frc.team555.robot.components.Lift;
import frc.team555.robot.components.MainLift;
import frc.team555.robot.core.PowerUpRobot;
import org.montclairrobotics.sprocket.auto.AutoMode;
import org.montclairrobotics.sprocket.auto.states.DriveEncoderGyro;
import org.montclairrobotics.sprocket.auto.states.DriveTime;
import org.montclairrobotics.sprocket.geometry.Angle;
import org.montclairrobotics.sprocket.states.State;
import org.montclairrobotics.sprocket.states.StateMachine;

import static frc.team555.robot.components.MainLift.TOP;

public class AutoClimbSequence extends StateMachine {

private Lift lift;
private double height;
private double power;
private boolean up;

public AutoClimbSequence(MainLift lift){
super(
new DriveEncoderGyro(10,
0.4,
Angle.ZERO,
true,
PowerUpRobot.correction

),

new MoveLift(lift,
TOP,
1,
true
),

new DriveTime(3,-0.5),
new MoveLift(lift,
TOP*0.3,
1,
false
)

);
}

State MoveLift = new State() {
@Override
public void start() {
power=Math.abs(power);
if(!up)
{
power=-power;
}
}

@Override
public void stop()
{
lift.setAuto(0);
}

@Override
public void stateUpdate() {
lift.setAuto(power);
}

@Override
public boolean isDone() {
return lift.getEncoder().getInches().get()>height==up;
}
};


}
11 changes: 11 additions & 0 deletions src/main/java/frc/team555/robot/auto/AutoStart.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package frc.team555.robot.auto;

import org.montclairrobotics.sprocket.auto.states.ResetGyro;
import org.montclairrobotics.sprocket.drive.steps.GyroCorrection;
import org.montclairrobotics.sprocket.states.StateMachine;
@Deprecated
public class AutoStart extends StateMachine {
public AutoStart(GyroCorrection correction){
super(new ResetGyro(correction));
}
}
22 changes: 22 additions & 0 deletions src/main/java/frc/team555/robot/auto/AutoSwitch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package frc.team555.robot.auto;

import frc.team555.robot.utils.Side;
import org.montclairrobotics.sprocket.auto.AutoMode;
import org.montclairrobotics.sprocket.states.State;
/*
public abstract class AutoSwitch extends AutoMode {
/*protected static double POWER = 0.75;

// public AutoSwitch(String name, State... states) {
super(name, states);
}

public static AutoSwitch fromMiddle() {
return new AutoSwitchMid(Side.fromDriverStation()[0]);
}

public static AutoSwitch fromSide(Side pos) {
return new AutoSwitchLR(pos, Side.fromDriverStation()[0]);
}
}
*/
33 changes: 33 additions & 0 deletions src/main/java/frc/team555/robot/auto/AutoSwitchLR.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package frc.team555.robot.auto;

import frc.team555.robot.core.PowerUpRobot;
import frc.team555.robot.utils.Side;
import org.montclairrobotics.sprocket.auto.states.DriveEncoderGyro;
import org.montclairrobotics.sprocket.auto.states.ResetGyro;
import org.montclairrobotics.sprocket.geometry.Angle;
import org.montclairrobotics.sprocket.utils.Input;
/*
class AutoSwitchLR extends AutoSwitch {
AutoSwitchLR(Side pos, Side target) {
super("Cube to " + target.toString() + " Switch (" + pos.toString() + ")",
/* Reset gyro
new ResetGyro(PowerUpRobot.correction),
/* Drive forward 12 inches
new DriveEncoderGyro(12, POWER, Angle.ZERO, true, PowerUpRobot.correction),
/* Turn π/2 radians (toward the nearest wall)
new DriveEncoderGyro(0,(pos == Side.RIGHT ? +1 : -1) * POWER, Angle.QUARTER,true, PowerUpRobot.correction),
/* Drive forward 36 inches
new DriveEncoderGyro(36, POWER, Angle.ZERO, true, PowerUpRobot.correction),
/* Turn π/2 radians (in the opposite direction)
new DriveEncoderGyro(0,(pos == Side.LEFT ? +1 : -1) * POWER, Angle.QUARTER,true, PowerUpRobot.correction),
/* Drive forward 36 inches
new DriveEncoderGyro(36, POWER, Angle.ZERO, true, PowerUpRobot.correction),
/* Turn π/2 radians (in the opposite direction)
new DriveEncoderGyro(0,(pos == Side.LEFT ? +1 : -1) * POWER, Angle.QUARTER,true, PowerUpRobot.correction),
/* Drive forward 12 inches OR 72 inches, depending on the target
new DriveEncoderGyro(pos == target ? 12 : 72, POWER, Angle.ZERO, true, PowerUpRobot.correction),
/* Move the lift, turn, and drop the cube into the switch
new DropCubeSwitch(new Input<Side>(){public Side get(){return pos;}}, PowerUpRobot.correction)
);
}
}*/
26 changes: 26 additions & 0 deletions src/main/java/frc/team555/robot/auto/AutoSwitchMid.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package frc.team555.robot.auto;

import frc.team555.robot.core.PowerUpRobot;
import frc.team555.robot.utils.Side;
import org.montclairrobotics.sprocket.auto.states.DriveEncoderGyro;
import org.montclairrobotics.sprocket.auto.states.ResetGyro;
import org.montclairrobotics.sprocket.geometry.Angle;
import org.montclairrobotics.sprocket.utils.Input;
/*
class AutoSwitchMid extends AutoSwitch {

AutoSwitchMid(Side target) {
super("Cube to " + target.toString() + " Switch (M)",
/* Reset gyro
new ResetGyro(PowerUpRobot.correction),
/* Drive forward 12 inches
new DriveEncoderGyro(12, POWER, Angle.ZERO, true, PowerUpRobot.correction),
/* Turn π/2 radians (in the correct directon)
new DriveEncoderGyro(0,(target == Side.RIGHT ? +1 : -1) * POWER, Angle.QUARTER, true, PowerUpRobot.correction),
/* Drive forward 36 inches
new DriveEncoderGyro(36, POWER, Angle.ZERO, true, PowerUpRobot.correction),
/* Move the lift, turn, and drop the cube into the switch
new DropCubeSwitch(new Input<Side>(){public Side get(){return target;}}, PowerUpRobot.correction)
);
}
}*/
34 changes: 34 additions & 0 deletions src/main/java/frc/team555/robot/auto/AutoWillTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//package frc.team555.robot.auto;
//
//import frc.team555.robot.core.PowerUpRobot;
//import frc.team555.robot.utils.Side;
//import org.montclairrobotics.sprocket.auto.states.DriveEncoderGyro;
//import org.montclairrobotics.sprocket.auto.states.ResetGyro;
//import org.montclairrobotics.sprocket.geometry.Angle;
//import org.montclairrobotics.sprocket.utils.Input;
//
//public class AutoWillTest extends AutoSwitch {
//
// public AutoWillTest(Side pos, Side target) {
// super("Cube to " + target.toString() + " Switch (" + pos.toString() + ")",
// /* Reset gyro */
// new ResetGyro(PowerUpRobot.correction),
// /* Drive forward 12 inches */
// new DriveEncoderGyro(12, POWER, Angle.ZERO, true, PowerUpRobot.correction),
// /* Turn π/2 radians (toward the nearest wall) */
// new DriveEncoderGyro(0,(pos == Side.RIGHT ? +1 : -1) * POWER, Angle.QUARTER,true, PowerUpRobot.correction),
// /* Drive forward 36 inches */
// new DriveEncoderGyro(36, POWER, Angle.ZERO, true, PowerUpRobot.correction),
// /* Turn π/2 radians (in the opposite direction) */
// new DriveEncoderGyro(0,(pos == Side.LEFT ? +1 : -1) * POWER, Angle.QUARTER,true, PowerUpRobot.correction),
// /* Drive forward 36 inches */
// new DriveEncoderGyro(36, POWER, Angle.ZERO, true, PowerUpRobot.correction),
// /* Turn π/2 radians (in the opposite direction) */
// new DriveEncoderGyro(0,(pos == Side.LEFT ? +1 : -1) * POWER, Angle.QUARTER,true, PowerUpRobot.correction),
// /* Drive forward 12 inches OR 72 inches, depending on the target */
// new DriveEncoderGyro(pos == target ? 12 : 72, POWER, Angle.ZERO, true, PowerUpRobot.correction),
// /* Move the lift, turn, and drop the cube into the switch */
// new DropCubeSwitch(new Input<Side>(){public Side get(){return pos;}}, PowerUpRobot.correction));
// /* Back away from switch
// }
//}
15 changes: 9 additions & 6 deletions src/main/java/frc/team555/robot/auto/DropCubeSwitch.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@

import frc.team555.robot.components.CubeIntake;
import frc.team555.robot.components.IntakeLift;
import frc.team555.robot.core.PowerUpRobot;
import frc.team555.robot.utils.Side;
import org.montclairrobotics.sprocket.auto.states.DriveEncoderGyro;
import org.montclairrobotics.sprocket.drive.steps.GyroCorrection;
import org.montclairrobotics.sprocket.geometry.Angle;
import org.montclairrobotics.sprocket.states.MultiState;
import org.montclairrobotics.sprocket.states.State;
import org.montclairrobotics.sprocket.states.StateMachine;
import org.montclairrobotics.sprocket.utils.Input;

public class DropCubeSwitch extends StateMachine {

private CubeIntake intake;
private IntakeLift lift;

public DropCubeSwitch(CubeIntake intake, IntakeLift lift, Side side, GyroCorrection correction){
super(new MultiState(0,
new SideTurn(correction,false, side),
new IntakeLiftMove(10, .75, true)
),
public DropCubeSwitch(Input<Side> side, GyroCorrection correction){
super(
new MultiState(0,
new SideTurn(correction,false, side),
new IntakeLiftMove(10, .75, true)
),
new DriveEncoderGyro(3, .5, Angle.ZERO, true, correction),
new CubeOuttake(intake, 1));
new CubeOuttake(PowerUpRobot.intake, 1));
}
}
22 changes: 22 additions & 0 deletions src/main/java/frc/team555/robot/auto/DropCubeTop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package frc.team555.robot.auto;

import frc.team555.robot.components.CubeIntake;
import frc.team555.robot.utils.Side;
import org.montclairrobotics.sprocket.auto.AutoState;
import org.montclairrobotics.sprocket.auto.states.DriveEncoderGyro;
import org.montclairrobotics.sprocket.auto.states.DriveTime;
import org.montclairrobotics.sprocket.drive.steps.GyroCorrection;
import org.montclairrobotics.sprocket.geometry.Angle;
import org.montclairrobotics.sprocket.states.StateMachine;
import org.montclairrobotics.sprocket.utils.Input;

public class DropCubeTop extends StateMachine {
public DropCubeTop(CubeIntake intake, GyroCorrection correction, Input<Side> side){
super(
new DriveEncoderGyro(140, .5, Angle.ZERO, false, correction),
new SideTurn(correction, false, side),
// new MainLiftMove(12,.5,true),
new DriveTime(2, .75)
);
}
}
Loading