Class ManipulatorSim
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
swervelib.simulation.ironmaple.simulation.opponentsim.ManipulatorSim
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddIntakeSimulation(String intakeName, IntakeSimulation intakeSimulation) Adds an intake simulation to the manipulator simulation.addProjectileSimulation(String projectileName, Supplier<GamePieceProjectile> projectileSimulation) Adds a projectile simulation to the manipulator simulation.getIntakeSimulation(String intakeName) Gets an intake simulation from the manipulator simulation.The Map ofIntakeSimulationtypes.getProjectileSimulation(String projectileName) Gets a projectile simulation from the manipulator simulation.The Map of theGamePieceProjectiletypes.Runs the intake, stops running the intake when the command ends.intakeUntilCollected(String intakeName) Runs intake(String) until the game piece count in the intake goes up.Adds a projectile to the simulation.scoreWithIntake(String intakeName, String projectileName) A command that only calls score(String) when there is greater than zero(>0)GamePiecein the intake.Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, periodic, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
ManipulatorSim
public ManipulatorSim()Creates a new manipulator simulation.
-
-
Method Details
-
getIntakeSimulations
The Map ofIntakeSimulationtypes.- Returns:
- a Map of
IntakeSimulationtypes.
-
getProjectileSimulations
The Map of theGamePieceProjectiletypes.- Returns:
- a Map of the
GamePieceProjectiletypes.
-
addIntakeSimulation
Adds an intake simulation to the manipulator simulation.- Parameters:
intakeName- The name of the intake simulation.intakeSimulation- The simulation to add.- Returns:
- this, for chaining.
-
addProjectileSimulation
public ManipulatorSim addProjectileSimulation(String projectileName, Supplier<GamePieceProjectile> projectileSimulation) Adds a projectile simulation to the manipulator simulation.- Parameters:
projectileName- The name of the projectile simulation.projectileSimulation- The simulation to add.- Returns:
- this, for chaining.
-
getIntakeSimulation
Gets an intake simulation from the manipulator simulation.- Parameters:
intakeName- The name of the intake simulation.- Returns:
- The simulation.
-
getProjectileSimulation
Gets a projectile simulation from the manipulator simulation.- Parameters:
projectileName- The name of the simulation.- Returns:
- The simulation.
-
intake
Runs the intake, stops running the intake when the command ends.- Parameters:
intakeName-- Returns:
-
intakeUntilCollected
Runs intake(String) until the game piece count in the intake goes up.- Parameters:
intakeName-- Returns:
-
score
Adds a projectile to the simulation.- Parameters:
projectileName- The name of the projectile simulation.- Returns:
- a command to add the game piece projectile to the simulation.
-
scoreWithIntake
A command that only calls score(String) when there is greater than zero(>0)GamePiecein the intake.- Parameters:
intakeName- the intake to check.projectileName- the piece to score.- Returns:
- score(String) when valid.
-