Skip to main content

Module 6 — Simulation, Logging, & QA

Objective: validate before field time.

Prereqs: Command-based project with subsystems.

Steps

  • Use Sim GUI to test joystick → motor behavior; verify autonomous commands run.
  • Add logging for key signals (voltage, current, encoder/gyro, setpoints).
  • Create a pre-field checklist (sim pass, logging enabled, controls verified).
  • Simulate brownouts/battery sag; confirm graceful degradation.
  • Validate NetworkTables keys for dashboards and note expected units.

Deliverables

  • Completed pre-field validation checklist with logs demonstrating expected behavior.
  • Saved log traces for a typical teleop cycle and one auto run.

Resources

  • Simulation intro: docs.wpilib.org/en/stable/docs/software/wpilib-tools/robot-simulation/simulation-intro.html
  • NetworkTables: github.com/wpilibsuite/allwpilib/tree/main/ntcore

Instructions (numbered)

  1. Run Sim GUI; verify joystick → motor behavior; run autos in sim.
  2. Enable logging for key signals (voltage, current, encoders/gyro, setpoints).
  3. Simulate brownouts/battery sag; ensure safe behavior and logging.
  4. Verify NetworkTables keys/units for dashboards; document expected ranges.
  5. Create and complete pre-field checklist; save log traces (teleop + auto).

Example

  • Sim shows drive responds to Xbox inputs; auto runs sequence; log files saved with voltage/current and pose; brownout sim reduces drive output gracefully.

Best practices

  • Test autos in sim before field; catch null bindings.
  • Keep logs versioned; compare across runs.
  • Document NT keys and units for dashboard consistency.

Common mistakes

  • No logging; hard to debug later.
  • Missing NT keys/units → broken dashboards.
  • Skipping brownout simulation.

Spec notes / data to log

  • Signals: joystick inputs, drivetrain outputs, encoder/gyro, voltage/current, setpoints.
  • Logs: save teleop + auto traces; note battery/brownout simulation settings.
  • NT: key names and units documented for dashboards.

Checklist

  • Sim GUI teleop tested
  • Autos tested in sim
  • Logging enabled and verified
  • Brownout/battery sag tested
  • NT keys/units documented
  • Logs saved (teleop + auto)

Recommended tools

  • Sim GUI, logging library (AdvantageKit/WPILib), NT client/dashboard, battery sim settings.

Sample log (template)

  • Date:
  • Tests run:
  • Issues found:
  • Logs saved at:
  • Next steps:

Photos/diagrams

  • [Placeholder: screenshot of Sim GUI and log plot]