Team 1540 (The Flaming Chickens) Robot Code Release

After the completion of our 2014 season, Team 1540 decided to post our season’s robot code publicly!

Our robot code is available on BitBucket.

This year was the first year that we used a large award-winning software framework - the Common Chicken Runtime Engine - and it paid off very well. Thanks to the CCRE’s emulator and other features, we were able to have most of our code ready and mostly tested before even our prototype robot was ready.

Some of our code’s cool features as compared to previous years:

  1. We were able to use the networking system from our framework to switch and tune autonomous modes very easily - last year, we lost multiple matches because the switches on our robot to control the autonomous mode were set incorrectly. This year, the drive team could change the autonomous mode up until the point that they were ordered behind the line before each match.
  2. We used an interesting system to winch back our shooter - we measured the number of joules going into the system (via the battery’s voltage sensor and a current sensor on the winch motor), and integrated it so that we could draw back to a specific total amount of energy added to the shooting mechanism - much more accurate than some of our other designs.
  3. We logged a useful amount of data about each match, and correspondingly could figure out, after a match, approximately what happened during it - including readouts on the shooter, arm, and pressure states. At least once, this let us figure out why an autonomous mode didn’t work or explain to the drive team issues with their driving.
  4. We had a really easy-to-use test mode, which would let us wrap motor allocations in a test-mode call, and then we could really easily run them individually from the driver station. (This also applied to higher-level components such as the drive train as a whole.) This worked better than last year, when we’d download a different project when we wanted this level of testing.
  5. Autonomous and Teleoperated shared a lot of code, which let us bypass a lot of issues about the robot working in one mode but not the other - the autonomous code would essentially press virtual buttons to control the winch, arm, and collector, for example. This worked much better than last year’s code when we had huge amounts of spaghetti code for everything.

Do you have comments and questions? We’ll answer any here.