Class Arena2024Crescendo
java.lang.Object
swervelib.simulation.ironmaple.simulation.SimulatedArena
swervelib.simulation.ironmaple.simulation.seasonspecific.crescendo2024.Arena2024Crescendo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classthe obstacles on the 2024 competition fieldNested classes/interfaces inherited from class swervelib.simulation.ironmaple.simulation.SimulatedArena
SimulatedArena.FieldMap, SimulatedArena.Simulatable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CrescendoAmpprotected doubleprotected intprotected final CrescendoSpeakerprotected final CrescendoAmpprotected doubleprotected intprotected final CrescendoSpeakerFields inherited from class swervelib.simulation.ironmaple.simulation.SimulatedArena
ALLOW_CREATION_ON_REAL_ROBOT, bluePublishers, blueScore, blueScoringBreakdown, blueTable, customSimulations, driveTrainSimulations, gamePieces, genericInfoTable, lastMeasuredTimestamp, matchClock, matchClockPublisher, opponentManager, physicsWorld, redPublishers, redScore, redScoringBreakdown, redTable, resetFieldPublisher, resetFieldSubscriber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactivateAmp(boolean isBlue) Activates the amp for the specified team.voidaddAmpCharge(boolean isBlue) Adds a charge to the amp of the specified team.booleanisAmped(boolean isBlue) Returns wether the specified team currently has an amped speakervoidPlaces Game Pieces on the Field for Autonomous Mode.voidsimulationSubTick(int tickNum) Processes a Single Simulation Sub-Tick.Methods inherited from class swervelib.simulation.ironmaple.simulation.SimulatedArena
addCustomSimulation, addDriveTrainSimulation, addGamePiece, addGamePieceProjectile, addIntakeSimulation, addToScore, addValueToMatchBreakdown, addValueToMatchBreakdown, clearGamePieces, disableBreakdownPublishing, enableBreakdownPublishing, gamePieceLaunched, gamePiecesOnField, getGamePiecesArrayByType, getGamePiecesByType, getGamePiecesPosesByType, getInstance, getOpponentManager, getScore, getScore, getSimulationDt, getSimulationSubTicksIn1Period, overrideInstance, overrideSimulationTimings, publishBreakdown, removeGamePiece, removePiece, removeProjectile, replaceValueInMatchBreakDown, replaceValueInMatchBreakDown, resetFieldForAuto, setupValueForMatchBreakdown, shutDown, simulationPeriodic, withOpponentManager
-
Field Details
-
blueAmpClock
protected double blueAmpClock -
blueAmpCount
protected int blueAmpCount -
redAmpClock
protected double redAmpClock -
redAmpCount
protected int redAmpCount -
redSpeaker
-
blueSpeaker
-
redAmp
-
blueAmp
-
-
Constructor Details
-
Arena2024Crescendo
public Arena2024Crescendo()
-
-
Method Details
-
placeGamePiecesOnField
public void placeGamePiecesOnField()Description copied from class:SimulatedArenaPlaces Game Pieces on the Field for Autonomous Mode.
This method sets up the game pieces on the field, typically in their starting positions for autonomous mode.
It should be implemented differently for each season-specific subclass of
SimulatedArenato reflect the unique game piece placements for that season's game.- Specified by:
placeGamePiecesOnFieldin classSimulatedArena
-
simulationSubTick
public void simulationSubTick(int tickNum) Description copied from class:SimulatedArenaProcesses a Single Simulation Sub-Tick.
This method performs the actions for each sub-tick of the simulation, including:
- Updating all registered
AbstractDriveTrainSimulationobjects. - Updating all
GamePieceProjectileobjects in the simulation. - Stepping the physics world with the specified sub-tick duration.
- Removing any game pieces as detected by the
IntakeSimulationobjects. - Executing any additional sub-tick actions registered via
SimulatedArena.addCustomSimulation(Simulatable).
- Overrides:
simulationSubTickin classSimulatedArena
- Updating all registered
-
isAmped
public boolean isAmped(boolean isBlue) Returns wether the specified team currently has an amped speaker
This function returns true during autonomous since the autonomous mode behaves exactly like amplified game play.
- Parameters:
isBlue- Wether to check the blue or red alliance.- Returns:
- Wether the specified alliance is currently amplified.
-
addAmpCharge
public void addAmpCharge(boolean isBlue) Adds a charge to the amp of the specified team. One charge is equal to one note in the amp so two charges are needed to use the amp.
- Parameters:
isBlue- Wether the charge is added to the blue or red alliance.
-
activateAmp
public boolean activateAmp(boolean isBlue) Activates the amp for the specified team.
- Parameters:
isBlue- Wether to amplify for the blue or red team.- Returns:
- Returns true if the amplification was successful and false if it was not.
-