Package frc.rebuilt
Class RobotBumpSim
java.lang.Object
frc.rebuilt.RobotBumpSim
Bump physics for the 2026 REBUILT field, to run alongside MapleSim. Tracks the robot's Z height,
pitch, and roll over the raised bumps, and takes over field X while the robot is on a ramp so it
slides back rather than ghosting through.
Cresting a bump needs 1.8 m/s, from sqrt(2 * g * 0.165).
While isOnRamp() is true the caller must push getSimWorldPose(edu.wpi.first.math.geometry.Pose2d) into MapleSim.
Positions are in metres, with the origin at the blue alliance driver-station corner.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSimWorldPose(Pose2d latestMaplePose) X comes from the ramp model; Y and rotation pass through fromlatestMaplePoseso MapleSim keeps owning lateral motion.booleanisOnRamp()While this returns true the caller must pushgetSimWorldPose(edu.wpi.first.math.geometry.Pose2d)into MapleSim, so the robot slides back instead of only appearing to.update(Pose2d robotPose2d, ChassisSpeeds fieldRelativeSpeeds, int subticks) Advances the sim by onePERIODand returns the robot's 3D pose.
-
Constructor Details
-
RobotBumpSim
- Parameters:
moduleOffsets- robot-relative module positions, in FL, FR, BL, BR order (metres).
-
-
Method Details
-
isOnRamp
public boolean isOnRamp()While this returns true the caller must pushgetSimWorldPose(edu.wpi.first.math.geometry.Pose2d)into MapleSim, so the robot slides back instead of only appearing to. -
getSimWorldPose
X comes from the ramp model; Y and rotation pass through fromlatestMaplePoseso MapleSim keeps owning lateral motion.- Returns:
- the pose to pass to
setSimulationWorldPose
-
update
Advances the sim by onePERIODand returns the robot's 3D pose. X is the ramp model's position while on the ramp, so the caller must also pushgetSimWorldPose(edu.wpi.first.math.geometry.Pose2d)into MapleSim.- Parameters:
subticks- physics sub-steps per period, which must match the value a companion ball sim uses. 5 gives 4 ms sub-steps in a 20 ms loop- Returns:
- the robot's 3D pose
-