For the 2016 FRC season, some of new students on the team created a miniature version of our competition robot, dubbed the ‘MiniBot’. While this robot was 1/3 the size of the team’s actual FRC robot, it did include many of the same features. The drive train and shooting mechanisms were similar and while the intake mechanism was somewhat different, from a programming point of view, it was very compatible. Both robots had drive wheel encoders, speed sensors for the shooting mechinism, a gyro to measure the robot’s orientation, as well as a camera for targeting.
This document is a case study on how this MiniBot can be programmed and we hope to show what might be possible in the future with our robots. The goal of this discussion is not to merely present the code, but to talk about how it was designed.
The MiniBot is controlled by a Raspberry Pi 3 and a couple of Arduino micro-controllers. The design and building of the actual robot will be covered in another document. The robot is programmed using in Java, using the IDE tool ‘Eclipse’. In another document, we will discuss how to set up the Eclipse and Raspberry Pi environments, but for now, we will assume that this has already been done.
This document also assumes that you have a working knowledge of Eclipse and Java, and a basic knowledge of the development environment for FRC programming in Java. Although we are not using the FRC programming environment, we have created an environment for the Raspberry Pi robot development which is very similar. Programmers who have worked with Java for FRC should feel right at home, and those who learn to program in this environment should be able to easily move to developing Java code for FRC robots.
So let’s get started. The first step is to create our MiniBot project.
When you work through these exercises you will be tempted to simply copy and paste the code into your program. I strongly advise you not to do that and, instead, type in the code line by line. Entering the code manually will help reinforce what you are seeing. It will also give you experience in finding and fixing mistakes that you make in transcribing the code.