This documentation will assist in connecting cameras from a project in WPILib to AdvantageScope, to use for testing with AprilTags in simulation.
Open WPILib
Open the project you want to work on
In top right-hand corner of screen click on the small WPILib Icon
Type in and click "Simulate Robot Code"
Make sure code builds successfully
When asked which extension to run, choose "Sim GUI" as opposed to "Use Real DriveStation" and click OK
This opens the simulation
Go back to WPILib, and re-click WPILib symbol in top right-hand corner
To open AdvantageScope, type into and click "Start Tool" > "AdvantageScope"
To connect WPILib Simulation:
File > Connect to Simulator
To import your layout into AdvantageScope:
File > Import Layout > AdvantageScope Swerve Calibration
To connect cameras:
In "Value List" to the left, go to PhotonVision > Camera > targetPose
Drag targetPose on top of robot into "Poses" at the bottom of the screen
Right-click the component just added in "Poses", and check "Vision Target" to make it a vision target as opposed to a component
TagPoses: 3D poses representing visible tags
RobotPoses: 3D poses representing raw pose estimates from the last cycle
RobotPosesAccepted: A set list of estimates that have gone through all the stages of filtering
RobotPosesRejected: A set of removed robot poses through filtering
Summary Table: Table of identical fields from from all the cameras
For more information: Vision Template— AdvantageKit Documentation