WPILib Classes - Team3021/Steamworks GitHub Wiki

Core Robot Class

  • Sample Robot: A basic robot; does not loop on its own
  • Iterative Robot: Periodic() methods are called every 20ms during appropriate game mode (Autonomous, TeleOperated)

We also created a command system in the 2017 robot Stanley which allows us to run small sets of instructions (e.g. turn 90 degrees left).

Command-Based Robot

  • Not a base class like Sample Robot and Iterative Robot, but available as an option for creating a new project
  • Easy way to create larger programs
  • Useful for writing autonomous sequences

Controllers

A controller is any object in the code that can direct the robot's motion. In addition to joysticks and button panels, this includes sensors like gyroscopes. Stanley supports these controllers:

  • Joystick (WPI class)
    • Joystick (physical)
    • Button Panel (called Xin-Mo Controller on drive station)
    • XBOX 360 controller
  • NAVX (gyroscope, third-party)
  • Vision controller (unused, would have been used to target reflective tape with camera)

Drive

  • Controls motors
  • Supports various control schemes (such as a tank drive with two control sticks) and chassey types (such as mecanum drives, which are capable of moving sideways)

Vision

  • Sent to the drive station
  • Would have been useful for targeting (reflective tape is placed on important game pieces for exactly this purpose) One of the multiple subsystems of the code

Subsystems

We organize the code based on the actual features of the robot. The subsystems in Stanley are:

  • Collector: fills the hopper with loose whiffle balls
  • Agitator: keeps hopper contents moving to prevent jamming
  • Indexer: regulates the flow of balls into the launcher or prevents them from entering while not launching
  • Launcher: spins up and launches the contents of the hopper

Devices

  • Talons: control the robot's motors
  • Relay: allows the code to close or open a circuit
  • Compressor (2016 robots): used to power the solenoids responsible for shifting gears

Smart Dashboard

The Java Smart Dashboard is an additional display on the drive station which anything can be added to from the code. We used it to display information on engines, information from the gyroscope, and options for the drivers such as which controller to use and which autonomous sequence to run.