Class RobotViz
Currently, this class publishes visualization data related to drivetrain state, including the robot's global pose and derived camera poses.
Future intent: This class is intended to become the single location responsible for publishing visualization data for all robot subsystems, such as elevators, arms, intakes, and other articulated mechanisms. Each subsystem will contribute geometry or pose data that can be rendered together in a unified visualization view.
This class supports both real and simulated operation:
- When a
SwerveSiminstance is provided, visualization data is sourced from the simulator's ground-truth drivetrain pose. - Otherwise, certain entries with keys indicating ground truth use estimates instead, often
duplicating other entries (e.g.
ActualPosewill be equivalent toGlobalEstPose).
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidperiodic()Publishes visualization data for the current control loop iteration.
-
Constructor Details
-
RobotViz
Creates a new visualization helper.- Parameters:
sim- optional swerve simulator; when provided, simulated ground-truth drivetrain pose is used for visualizationswerve- live swerve subsystem providing pose estimates when not simulating
-
-
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).As additional subsystems are integrated, this method will be extended to publish poses, transforms, and geometry for other mechanisms relative to the robot frame.
-