Package frc.robot.viz
Class RobotViz
java.lang.Object
frc.robot.viz.RobotViz
Centralized visualization helper for publishing robot state to logging and visualization tools.
This class is responsible for publishing robot poses, mechanism transforms, and subsystem
geometry to Logger for visualization tools such as AdvantageScope. It computes both
estimated and (when available) ground-truth representations of the robot state.
Estimated vs Ground-Truth Data
- Estimated data is sourced from live subsystems (swerve, turret, hood, etc.) and reflects what the robot believes its state to be.
- Ground-truth data is sourced from
SimulatedRobotStatewhen running in simulation. When not simulating, ground-truth outputs are aliased to the estimated state.
All outputs are published via Logger and are intended strictly for debugging, analysis,
and visualization (e.g., AdvantageScope). No control or decision-making logic should depend on
this class.
-
Constructor Summary
ConstructorsConstructorDescriptionRobotViz(@Nullable SimulatedRobotState sim, Swerve swerve, Turret turret, AdjustableHood hood, Intake intake, Climber climber) Creates a new visualization helper. -
Method Summary
Modifier and TypeMethodDescriptionvoidperiodic()Publishes visualization data for the current control loop iteration.
-
Constructor Details
-
RobotViz
public RobotViz(@Nullable SimulatedRobotState sim, Swerve swerve, Turret turret, AdjustableHood hood, Intake intake, Climber climber) Creates a new visualization helper.The visualization system automatically switches between estimated-only and estimated-plus-ground-truth modes depending on whether a simulation state is provided.
- Parameters:
sim- simulation state used for ground-truth visualization; may benullswerve- live swerve subsystem providing pose estimatesturret- live turret subsystemhood- adjustable hood subsystemintake- intake subsystemclimber- climber subsystem
-
-
Method Details
-
periodic
public void periodic()Publishes visualization data for the current control loop iteration.This method should be called periodically (e.g., from
robotPeriodic).
-