This topic will walk you through the process of building the robot used for the Robot Java tutorials. My goal in designing the robot was to create a relatively inexpensive robot that can be used to introduce the students to robotics programming. In doing so, I wanted to create an environment that would be as similar to the FRC robot programming environment as possible. Since our team has chosen to Java for it’s programming, the robots could no longer use the Arduinos that we had used in previous years.
I originally used an inexpensive Raspberry Pi Zero W but the newer version of the FRC command library required a Java 8 which will not run on a Zero so I switched to using a Raspberry Pi 3.
I also made the decision to use a Arduino as well. There are several reasons for this. The first is that the Linux operating system that runs on the Raspberry Pi isn’t that that well suited to controlling low level hardware (there is only one hardware PWM pin for example). In addition if we use an Arduino, we will have access to a very large library of code which can control any number of devices and sensors. This code is all written in C++ and would probably be difficult to port to the Raspberry Pi, especially since we are using Java.
The communications between the Arduino and the Raspberry Pi is done via the serial ports on both and a very simple ascii protocol is used.