View Single Post
  #1   Spotlight this post!  
Unread 01-02-2014, 11:39 PM
nightpool's Avatar
nightpool nightpool is offline
robotRectifier
AKA: Evan
no team (formerly of CORE 2062)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 81
nightpool is on a distinguished road
2013 CORE Robot Utilities

Presenting the CORE 2062 robot utilities from 2013.
https://github.com/core2062/CORERobot

Our robot is coded with a subsystem framework that is lighter-weight then the command based framework. Each subsystem gets the teleop() function called once per frame, and input is handled in a joystick cache that prevents input lag. Subsystems own their own motors and sensors, and anything else they need.

This code also includes our Autonomous scheduler and some drive utilities.
The Autonomous scheduler is our way of organizing the auto code. Autonomous is divided up into independent “Actions”. Each Action is called once per frame, and returns a value that controls whether it continues or not. An optional feature is for a task to send itself to the “background”. Actions in the background continue to be called, but a new Action takes its place in the “main” spot.

Feedback is always welcome, and we're interested to see what other teams think of this, as it worked really well for us both performance and structure wise in 2013. Documentation is sparse, but I'm always happy to answer any questions.

Our 2013 robot code, where you can see an older version of most of these utilities in use is at https://github.com/core2062/core2013
The main difference is in the Caching joystick, which was just developed this summer. Previously we had three functions in each subsystem, one for each of inputs and outputs and one for logic. All of the input functions would be called for each subsystem, then logic, and such. The problem is that everything would need a class member to hold frame-state between the input and logic and output functions. We developed the caching joystick to help fix that. We were hoping to write a similar OutputQueue, but we ran out of offseason time. Oh well!
__________________
Proud alum of CORE 2062.
www.core2062.com
Reply With Quote