Pathplanner Projects
Pathfinding on Pathplanner
Objectives
- Implement pathfinding command to an arbitrary position on the field in Simulation and on Hardware
- Use Advantagescope to view and analyze data from live sources
- Simulate code before deploying to a robot
Prepare Development Environment
You will need a laptop with WPILIB VS code, Pathplanner, AdvantageScope, Driver station (if using robot)
Checkout pathplanner-pathfinding
branch of Team3176/Code_2024
Simulate Base Code
verify that the robot code is set for simulation in Constants.java
the robot type should be RobotType robot = RobotType.ROBOT_SIMBOT;
Click the three dots as if you were deploying and select "Simulate Robot Code"
select "Sim GUI"
Set driver station to Blue 1
Then set robot to disabled
You can only change the robot alliance station when the robot is in Disconnected state
Setup AdvantageScope
Check preferences under Help -> Show Preferences. Set Live source to NetworkTables 4
Connect to the Simulator by File -> Connect to Simulator
Add a 3d Field widget by clicking the plus
On the 3d Field add the robot pose under AdvantageKit/RealOutputs/Drivetrain/Pose. Drag the field into the 2d Poses
Drive in simulation
Using the "IJKL" for translation and "WASD" for rotation click into the Robot Simulation window for your keyboard inputs to be registered
you should see the values change in the joysticks panel
Enable the robot in the robot state to teleoperated
try driving around with the "keyboard joysticks" (IJKL) and follow the pose on AdvantageScope
Your keyboard inputs are only registered if you are clicked into the robot simulation window. Move this window to one the bottom of your screen and AdvantageScope to the top