Lab 12: Graduation (Compare With YAGSL)¶
Goal: read YAGSL's structure and find every piece we built. Then write the team's debugging guide.
This is the first time YAGSL (or any template swerve code) is allowed.
Mapping¶
Fill in the right column by reading the YAGSL docs and source:
| What we built | Lab | YAGSL equivalent |
|---|---|---|
ModuleIO / real hardware setup, CAN IDs |
0, 11 | |
| Inversions | 1, 11 | |
| Gear ratios, conversion factors | 1 | |
| Steer PID | 2 | |
| Encoder offsets | 3, 11 | |
MyModuleOptimizer |
4 | |
MyKinematics, desaturation |
5 | |
| Drive feedforward + PID, cosine scaling | 6 | |
| Gyro sign, field-relative | 7 | |
MyOdometry |
8 | |
| Discretization | 9 | |
| Drive to pose | 10 |
What YAGSL adds¶
For each, write one line on why it matters:
- Heading correction (holding heading while translating)
- Simulation models (compare to our
sim/package) - Support for many motors, encoders, and gyros
- Anything else you find
Experiment¶
Set up YAGSL on the real robot (or in its simulator) using our measured values: offsets, ratios, kS/kV, inversions. Does it drive the same? If not, which of our labs explains the difference?
Team doc: "What we'd check first when swerve misbehaves"¶
Write it from experience. Start with what bit us in these labs:
| Symptom | First thing to check | Lab |
|---|---|---|
| One wheel points off from the rest | Its encoder offset | 3 |
| One wheel points right but drives backward | Offset 180° off (bevel gear flipped) | 3 |
| Module spins forever | Encoder direction vs. steer inversion | 1, 2 |
| Pure rotation looks wrong | Module order, module position signs | 5 |
| Field-relative fine at 0°, wrong at 90° | Gyro sign | 7 |
| Odometry off by a steady % | Wheel diameter or gear ratio | 8 |
| Drifts in an arc while spinning | Discretization | 9 |
Checkpoint¶
Quiz
- Which YAGSL config holds our encoder offsets?
- Name two things YAGSL does that we didn't.
- A YAGSL robot drives the wrong way when you push forward. What do you check first?
What could go wrong in the real world: trusting config values copied from another team's robot; assuming the library hides hardware problems (it doesn't: offsets, inversions, and gyro sign still have to be right).