Coding this year has been the biggest hurdle we have faced, but it has been a skill that we have progressed a lot in. Last year, there were chiefly seniors working on the code because that was who the team was mostly comprised of. This year, we had many new and incredibly skilled members join the team, but there were none that had experience coding an FTC robot. Even with this difficulty, we pushed through by doing an immense amount of research and development as well as studying previous years code. At the start of the season, we had two goals for coding our robot. We wanted to use encoders to precisely drive and control our robot, and we wanted to use sensors to allow the robot to respond to its surroundings.
Using encoders, a sensor to detect the rotation of a motor, for our robot was a skill that we tried hard to implement this season and we had some successes with them. Going into the qualifying tournament, we had an encoder on our lifting arm that lowered the robot while in autonomous mode, but we did not have enough time to code the rest of our autonomous before the tournament. We planned on using encoders for the drivetrain in autonomous, and we started to work harder on that leading up to this competition. Unfortunately, around a week before our first tournament, all of our code deleted due to corrupted save files. This remained a major setback and all other work was put on hold until we could reprogram our robots. We worked tirelessly on rewriting all of our code, and we managed to rewrite our lowering code using encoders, but we were running into difficulties with our drive wheel encoders. We decided that we did not have time to continue to work on the encoder code so we, unfortunately, had to switch to using the operating time as control for our drive wheels.
Key algorithms: In our sensing algorithm, our robot uses the control phone’s built in camera to determine the type and position of the minerals that it is seeing. The camera is only wide enough to see two minerals at a time but that is all we need to execute the sampling portion correctly. If the two minerals that we see are silver, we know that the last mineral is gold and we can move to that position. Similarly, if we see that one of them is gold, we compare the X value coordinates of the gold and silver minerals to determine the position of of the gold mineral. Based off of the position of the gold mineral given by the sensor, the robot will choose one of three different paths and knock off the gold mineral and drop the marker in the depot.
In our autonomous code, we have separate methods for the different key parts of the code that we needed to test. We did this because we wanted to be able to easily single out and test different parts of the code by simply commenting out one line. Having this also made it very easy to have multiple people working on the code at once because we could have different people working on different methods and we would not need to change things like motor names. This has been really helpful in the developing of our code and it is something that we plan on continuing to use in the future.
Driver controlled enhancements: We use encoder values from the motor that controls our lift arm to ensure that we are high enough off of the ground. In our original design, we had to hold down a trigger to control the lift motor. While offering a quick and easy way to stop the lift in case of emergency, our drivers were unsure if the robot was fully off of the ground. This new system will allow us to be sure that the robot is all the way up before the end of the match.
A mock drawing of the path our robot takes during the autonomas period