Despite our best intentions to make our code release earlier, the combination of non-FRC life, other FRC items to do, and wanting to have more time to improve the code, we are again in the week before kickoff when making our code release. Nonetheless, here it is – our 2019 code, including the minor updates we made to support the 2020 beta control system. We may still make some additional check-ins during the next few days to bring the code release up to date with the final pre-kickoff beta software.
Autonomous remains one of our areas of focus; this year we had 25 different autonomous routines (programs or subprograms) in our robot code, many of which were parameterized to allow for different situations, such as right/left starting options for HAB2 or target height for delivering a hatch panel to the rocket. These autonomous programs were made up of smaller building blocks that performed such things as driving portions of the drive path, placement of a hatch panel on the cargo ship or rocket (at various heights), or retrieval of a hatch panel from the human player station, etc. The more complex autonomous programs were sequences of the autonomous program building blocks, all strung together using the Command-based robot features.
All of our programs had “StartRight” and “StartLeft” variants which used the same code for all but the parameter for starting position.
Our mainstay autonomous program was the HAB2HPtoShipSideBackwards(startSide) program, which started on HAB2, delivered the starting hatch panel to the center side port of the cargo ship, then picked up a second HP from the loading station and delivered it to the nearest port of the cargo ship. Placement of the hatch panels was aided by vision tracking, enabling the needed accuracy to deliver and place hatch panels, which required about +/- 1.5" of left/right accuracy. Yes, we generally ran a “fully autonomous” program during the sandstorm period, only using driver control during sandstorm if the autonomous program went badly, generally as a result of unplanned alliance member collisions. This autonomous program can be seen in Qual 44 on Curie: https://www.youtube.com/watch?v=PMrc2WNP4rg
If seeking to get a head start on the rocket, we would regularly use the StartRightHAB2HPtoRocketLowTwice() program, which would deliver one hatch to the near side of the rocket and one to the far side of the rocket, both on the low level. We had a “High” variant of this program, too, which differed only by instead passing in a different target height parameter. This autonomous program can be seen in Qual 85 on Curie: https://www.youtube.com/watch?v=1pc474SnW4w (That match also happens to show our fast HAB Level 3 climb – we drove onto HAB L1 with only 4 seconds on the clock and made it to L3!)
Our autonomous driving paths are almost exclusively done by a “DriveStraightOnHeading” command which has the robot drive an odometry-measured distance on a given heading (specified in degrees) with closed-loop robot steering to drive on the specified heading. Nearly all of our “turns” in autonomous driving are handled by the closed-loop control of “DriveStraightOnHeading.” In other words, if we “go straight and then turn left,” we would do this as follows: drive forward 100 inches on a heading of zero degrees, and then drive forward 100 inches on a heading of 270 degrees. The robot will drive forward 100 inches and then do an arcing left turn onto a new heading of 270 degrees. No “turn” command is actually specified. This makes for easy, smooth navigation. (Well, as long as the navX gyro works properly, which it did for us very reliably.) This is a different approach than the path-following approach now starting to be adopted by many teams. There are advantages / disadvantages to each.
I should probably also mention our “one-button” HAB climb routines for HAB Level 3 and HAB Level 2. Our 4-bar linkage climber for HAB Level 3 wasn’t particularly complicated to deploy manually, but the automated “one-button” routine which combined driving tasks and linkage deployment made it highly reliable and fast. By the time of the world championship, we also had a quick HAB Level 2 climb routine, even though that had been a secondary capability after a fast and reliable HAB L3 routine. See AutoClimb() and AutoClimbL2() for these routines.
Some videos of our L3 climb development are on our youtube page:
Whole Playlist, from the beginning: https://www.youtube.com/playlist?list=PLWOTPbsJppmLYmvPucTMnpY80LYhcBw1j
Climb as of Week 1 Event: https://www.youtube.com/watch?v=k8EFUYuiSls&list=PLWOTPbsJppmLYmvPucTMnpY80LYhcBw1j&index=11
(We did make the climb a little faster by the end of the season - down to less then 3 seconds, as shown in the Curie Qual 85 match linked above.)
Another thing I should probably mention is that we used the LED lights on the robot for communication with our drive team – different colors and flashing patterns communicated status of various robot mechanisms – this turned out to be a time-saver for the drivers when trying to shave a few more seconds from cycle times.
This year (like 2018), we are again releasing our code by making public our “2019-Robot” repository on github so that all can see it: https://github.com/FRC1519/2019-Robot
Feel free to post questions here or to email or PM me if I don’t seem to be paying attention to this thread during the build season…