-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sim + Elevator and Wrist Integration + some name changes
- Loading branch information
1 parent
f0f8260
commit f3218e8
Showing
8 changed files
with
204 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"keyboardJoysticks": [ | ||
{ | ||
"axisConfig": [ | ||
{ | ||
"decKey": 65, | ||
"incKey": 68 | ||
}, | ||
{ | ||
"decKey": 87, | ||
"incKey": 83 | ||
}, | ||
{ | ||
"decKey": 69, | ||
"decayRate": 0.0, | ||
"incKey": 82, | ||
"keyRate": 0.009999999776482582 | ||
} | ||
], | ||
"axisCount": 3, | ||
"buttonCount": 4, | ||
"buttonKeys": [ | ||
90, | ||
88, | ||
67, | ||
86 | ||
], | ||
"povConfig": [ | ||
{ | ||
"key0": 328, | ||
"key135": 323, | ||
"key180": 322, | ||
"key225": 321, | ||
"key270": 324, | ||
"key315": 327, | ||
"key45": 329, | ||
"key90": 326 | ||
} | ||
], | ||
"povCount": 1 | ||
}, | ||
{ | ||
"axisConfig": [ | ||
{ | ||
"decKey": 74, | ||
"incKey": 76 | ||
}, | ||
{ | ||
"decKey": 73, | ||
"incKey": 75 | ||
} | ||
], | ||
"axisCount": 2, | ||
"buttonCount": 4, | ||
"buttonKeys": [ | ||
77, | ||
44, | ||
46, | ||
47 | ||
], | ||
"povCount": 0 | ||
}, | ||
{ | ||
"axisConfig": [ | ||
{ | ||
"decKey": 263, | ||
"incKey": 262 | ||
}, | ||
{ | ||
"decKey": 265, | ||
"incKey": 264 | ||
} | ||
], | ||
"axisCount": 2, | ||
"buttonCount": 6, | ||
"buttonKeys": [ | ||
260, | ||
268, | ||
266, | ||
261, | ||
269, | ||
267 | ||
], | ||
"povCount": 0 | ||
}, | ||
{ | ||
"axisCount": 0, | ||
"buttonCount": 0, | ||
"povCount": 0 | ||
} | ||
], | ||
"robotJoysticks": [ | ||
{ | ||
"guid": "030000004c050000cc09000000000000" | ||
}, | ||
{ | ||
"guid": "030000004c050000cc09000000000000" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package frc.robot; | ||
|
||
import static edu.wpi.first.wpilibj2.command.Commands.*; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.AlgaeGrabberSubsystem; | ||
import frc.robot.subsystems.CheeseStickSubsystem; | ||
import frc.robot.subsystems.ClimberSubsystem; | ||
import frc.robot.subsystems.DriveSubsystem; | ||
import frc.robot.subsystems.ElevatorSubsystem; | ||
import frc.robot.subsystems.WristSubsystem; | ||
|
||
public class CommandComposer { | ||
private static DriveSubsystem m_driveSubsystem; | ||
private static AlgaeGrabberSubsystem m_algaeGrabberSubsystem; | ||
private static CheeseStickSubsystem m_cheeseStickSubsystem; | ||
private static ClimberSubsystem m_climberSubsystem; | ||
private static ElevatorSubsystem m_elevatorSubsystem; | ||
private static WristSubsystem m_wristSubsystem; | ||
|
||
private static Command scoreLevel(Supplier<Command> levelCommand) { | ||
return sequence( | ||
levelCommand.get(), | ||
m_wristSubsystem.goToAngle(35), | ||
m_elevatorSubsystem.lowerToScore(), | ||
m_cheeseStickSubsystem.goLeft(), // TODO: Left is release? | ||
m_cheeseStickSubsystem.goRight(), | ||
levelCommand.get(), | ||
m_wristSubsystem.goToAngle(-90)); | ||
} | ||
|
||
public static Command scoreLevelFour() { | ||
return scoreLevel(m_elevatorSubsystem::goToLevelFourHeight); | ||
} | ||
|
||
public static Command scoreLevelThree() { | ||
return scoreLevel(m_elevatorSubsystem::goToLevelThreeHeight); | ||
} | ||
|
||
public static Command scoreLevelTwo() { | ||
return scoreLevel(m_elevatorSubsystem::goToLevelTwoHeight); | ||
} | ||
|
||
public static Command scoreLevelOne() { | ||
return scoreLevel(m_elevatorSubsystem::goToLevelOneHeight); | ||
} | ||
|
||
public static Command prepareForCoralPickup() { | ||
return sequence( | ||
m_elevatorSubsystem.goToCoralStationHeight(), | ||
m_wristSubsystem.goToAngle(-90)); | ||
} | ||
|
||
public static Command pickupAtCoralStation() { | ||
return sequence( | ||
m_cheeseStickSubsystem.goLeft(), | ||
m_elevatorSubsystem.goToCoralStationHeight(), | ||
m_cheeseStickSubsystem.goRight()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters