Setting Up RobotPoses for AdvantageScope Simulation

Use this guide to make your subsystem RobotPose components move correctly in AdvantageScope simulation.

In SolidWorks

Measure each component pivot point relative to the SolidWorks origin and record those values.

In Code

Record each pivot measurement relative to the front of the robot in this order:

  1. x = forward/back
  2. y = left/right
  3. z = up/down

If you measured from a different CAD origin, convert to front-relative values first using your measured origin offset.

WPILib Robot Coordinate System

Rule of Thumb for Building Mechanism Poses

  • Use Pose3d.kZero when placing a mechanism pose relative to the robot origin.
  • For connected mechanisms (for example, a hood on a turret or an intake on an elevator), replace Pose3d.kZero with the parent mechanism's current Pose3d (for example, the turret Pose3d for a hood, or the elevator Pose3d for an intake).
  • Use .transformBy(...) for slides and translation-based motion (for example, elevators or sliding intakes).
  • Use .rotateAround(...) for pivots and rotation-based motion (for example, turrets, hoods, or pivot intakes).

Warning

If a value looks flipped in simulation, verify sign (+ vs -) before changing anything else.

In AdvantageScope

  1. Grab the *PivotPoint objects from RobotPoses/ section in advantage scope and add to poses.
  2. Right click the object and set to axis (or cone if you can't see it well).
  3. Compare axis/cones locations to your expected mechanism pivot points.
  4. If axis/cones are incorrect, check:
    • measurement correctness,
    • coordinate order (x, y, z),
    • sign (positive vs negative).
  5. Correct one axis at a time:
    • If the cone/axis is mirrored front/back, flip the sign of x.
    • If the cone/axis is mirrored left/right, flip the sign of y.
    • If the cone/axis is mirrored up/down, flip the sign of z.
    • If the cone/axis moves in a completely wrong direction, verify the axis order is still x, then y, then z.
  6. After cone placement is correct, test mechanism motion in simulation.

If the cone locations are wrong, the mechanism will not move correctly in simulation. Do not continue until cone placement looks correct.