Class Arena2026Rebuilt
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classthe obstacles on the 2026 competition fieldNested classes/interfaces inherited from class org.ironmaple.simulation.SimulatedArena
SimulatedArena.FieldMap, SimulatedArena.Simulatable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BooleanPublisherprotected static Translation2dprotected RebuiltHubprotected booleanprotected RebuiltOutpostprotected static Translation2dprotected doubleprotected booleanprotected DoublePublisherprotected BooleanPublisherprotected static Translation2dprotected RebuiltHubprotected RebuiltOutpostprotected booleanFields inherited from class org.ironmaple.simulation.SimulatedArena
ALLOW_CREATION_ON_REAL_ROBOT, bluePublishers, blueScore, blueScoringBreakdown, blueTable, customSimulations, driveTrainSimulations, gamePieces, genericInfoTable, matchClock, matchClockPublisher, physicsWorld, redPublishers, redScore, redScoringBreakdown, redTable, resetFieldPublisher, resetFieldSubscriber -
Constructor Summary
ConstructorsConstructorDescriptionCreates an Arena for the 2026 FRC game rebuiltArena2026Rebuilt(boolean AddRampCollider) Creates an Arena for the 2026 FRC game rebuilt -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPieceWithVariance(Translation2d piecePose, Rotation2d yaw, Distance height, LinearVelocity speed, Angle pitch, double xVariance, double yVariance, double yawVariance, double speedVariance, double pitchVariance) Adds a game piece too the arena with a certain random variance.booleanReturns wether or not the arena is in Efficiency modeObtains the 3D Poses of a Specific Type of Game Piece.booleanisActive(boolean isBlue) Returns wether the specified team currently has an active HUBvoidoutpostDump(boolean isBlue) Dumps game pieces from the specified outpost.voidoutpostThrow(boolean isBlue, Rotation2d throwYaw, Angle throwPitch, LinearVelocity speed) Throws a game piece from the outpost at the specified angle and speed.voidoutpostThrowForGoal(boolean isBlue) Attempts too throw a game piece at the specified goal.voidPlaces Game Pieces on the Field for Autonomous Mode.static doublerandomInRange(double variance) Generates a random number within a range centered on 0 with a variance set by the parameter.voidsetEfficiencyMode(boolean efficiencyMode) Determines wether the arena is in efficiency modevoidsetShouldRunClock(boolean shouldRunClock) Used to determine wether the arena should time which goal is active.voidsimulationSubTick(int tickNum) Processes a Single Simulation Sub-Tick.Methods inherited from class org.ironmaple.simulation.SimulatedArena
addCustomSimulation, addDriveTrainSimulation, addGamePiece, addGamePieceProjectile, addIntakeSimulation, addToScore, addValueToMatchBreakdown, addValueToMatchBreakdown, clearGamePieces, disableBreakdownPublishing, enableBreakdownPublishing, gamePieceLaunched, gamePiecesOnField, getGamePiecesArrayByType, getGamePiecesByType, getInstance, getScore, getScore, getSimulationDt, getSimulationSubTicksIn1Period, overrideInstance, overrideSimulationTimings, publishBreakdown, removeGamePiece, removePiece, removeProjectile, replaceValueInMatchBreakDown, replaceValueInMatchBreakDown, resetFieldForAuto, setupValueForMatchBreakdown, shutDown, simulationPeriodic
-
Field Details
-
shouldClock
protected boolean shouldClock -
clock
protected double clock -
blueIsOnClock
protected boolean blueIsOnClock -
phaseClockPublisher
-
redActivePublisher
-
blueActivePublisher
-
blueHub
-
redHub
-
blueOutpost
-
redOutpost
-
isInEfficiencyMode
protected boolean isInEfficiencyMode -
centerPieceBottomRightCorner
-
redDepotBottomRightCorner
-
blueDepotBottomRightCorner
-
-
Constructor Details
-
Arena2026Rebuilt
public Arena2026Rebuilt()Creates an Arena for the 2026 FRC game rebuilt
This will create an Arena with the ramp areas marked as inaccessible. If you would like to change that use
Arena2026Rebuilt(boolean). Additionally due to performance issues the arena will not spawn all fuel by default. If you would like to change this usesetEfficiencyMode(boolean) -
Arena2026Rebuilt
public Arena2026Rebuilt(boolean AddRampCollider) Creates an Arena for the 2026 FRC game rebuilt
Due to the nature of maple sim they can not be fully simulated and so either must be non existent or treated as full colliders. This behavior can be changed with the AddRampCollider variable. Additionally due to performance issues the arena will not spawn all fuel by default. If you would like to change this use
setEfficiencyMode(boolean)- Parameters:
AddRampCollider- Whether or not the ramps should be added as colliders.
-
-
Method Details
-
randomInRange
public static double randomInRange(double variance) Generates a random number within a range centered on 0 with a variance set by the parameter.
- Parameters:
variance- the length of range used to generate the random number.- Returns:
- A random number in range.
-
addPieceWithVariance
public void addPieceWithVariance(Translation2d piecePose, Rotation2d yaw, Distance height, LinearVelocity speed, Angle pitch, double xVariance, double yVariance, double yawVariance, double speedVariance, double pitchVariance) Adds a game piece too the arena with a certain random variance.
This method is useful for certain spawners like the return cutes on the hub to prevent the game pieces from being returned to the exact same position every time.- Parameters:
info- the info of the game piecerobotPosition- the position of the robot (not the shooter) at the time of launching the game pieceshooterPositionOnRobot- the translation from the shooter's position to the robot's center, in the robot's frame of referencechassisSpeedsFieldRelative- the field-relative velocity of the robot chassis when launching the game piece, influencing the initial velocity of the game pieceshooterFacing- the direction in which the shooter is facing at launchinitialHeight- the initial height of the game piece when launched, i.e., the height of the shooter from the groundlaunchingSpeed- the speed at which the game piece is launchshooterAngle- the pitch angle of the shooter when launchingxVariance- The max amount of variance that should be added too the x coordinate of the game piece.yVariance- The max amount of variance that should be added too the y coordinate of the game piece.yawVariance- The max amount of variance that should be added too the yaw of the game piece.speedVariance- The max amount of variance that should be added too the speed of the game piece.pitchVariance- The max amount of variance that should be added too the pitch of the game piece.
-
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
-
getGamePiecesPosesByType
Description copied from class:SimulatedArenaObtains the 3D Poses of a Specific Type of Game Piece.
This method is used to visualize the positions of game pieces
Also, if you have a game-piece detection vision system (wow!), this is the how you can simulate it.
Both
GamePieceOnFieldSimulationandGamePieceProjectileof the specified type will be included.- The type is determined in the constructor of
GamePieceOnFieldSimulation. - For example,
CrescendoNoteOnFieldhas the type "Note".
- Overrides:
getGamePiecesPosesByTypein classSimulatedArena- Parameters:
type- the type of game piece, as determined by the constructor ofGamePieceOnFieldSimulation- Returns:
- a
ListofPose3dobjects representing the 3D positions of the game pieces
- The type is determined in the constructor of
-
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
-
isActive
public boolean isActive(boolean isBlue) Returns wether the specified team currently has an active HUB
This function returns true during autonomous or when shouldClock (set bysetShouldRunClock(boolean)) is false.- Parameters:
isBlue- Wether to check the blue or red alliance.- Returns:
- Wether the specified alliance's HUB is currently active
-
setShouldRunClock
public void setShouldRunClock(boolean shouldRunClock) Used to determine wether the arena should time which goal is active.
When this is set too false both goals will always be set to active. Ths can be useful for testing or too simulate endgame.- Parameters:
shouldRunClock-
-
outpostDump
public void outpostDump(boolean isBlue) Dumps game pieces from the specified outpost.
This function will dump up to 24 game pieces, dependent on how many game pieces are currently stored in the outpost. For more manual control of the game pieces in the outpost useoutpostThrow(boolean, Rotation2d, Angle, LinearVelocity). To have a human player attempt to throw a game piece into the hub useoutpostThrowForGoal(boolean).- Parameters:
isBlue- wether to dump the blue or red outpost
-
outpostThrowForGoal
public void outpostThrowForGoal(boolean isBlue) Attempts too throw a game piece at the specified goal.
This method comes with variance built in (to simulate human inconsistency) and will therefore only hit about half the time. Additionally if the hub does not have game pieces stored this method will not do anything. If you would like to manually control how the human player throws game pieces use
outpostThrow(boolean, Rotation2d, Angle, LinearVelocity)- Parameters:
isBlue- whether too throw for the blue or red HUB.
-
outpostThrow
public void outpostThrow(boolean isBlue, Rotation2d throwYaw, Angle throwPitch, LinearVelocity speed) Throws a game piece from the outpost at the specified angle and speed.
This method comes with variance built in (to simulate human inconsistency). Additionally if the hub does not have game pieces stored this method will not do anything. If you would like to have the human player throw at the hub use
outpostThrowForGoal(boolean)- Parameters:
isBlue- Wether too throw from the blue or red OUTPOST.throwYaw- The yaw at which too throw the ball.throwPitch- The pitch at which too throw the ball.speed- The speed at which too throw the ball.
-
setEfficiencyMode
public void setEfficiencyMode(boolean efficiencyMode) Determines wether the arena is in efficiency mode
For changes too take effect call
SimulatedArena.resetFieldForAuto().Efficiency mode reduces the amount of game pieces on the field too increase performance. MapleSim was not designed with 400 game pieces in mind and so can struggle with the large number of game pieces present in rebuilt.
- Parameters:
efficiencyMode- Wether efficiency mode should be on or off.
-
getEfficiencyMode
public boolean getEfficiencyMode()Returns wether or not the arena is in Efficiency mode
For more information seesetEfficiencyMode(boolean)- Returns:
- Wether or not the Arena is in efficiency mode.
-