Advanced Robotics Programming
The Advanced Robotics Programming Class focuses on teaching our Titan Robotics Framework (TRC Library). The target audience of this Programming Class is for students who already have basic knowledge of the Java language. The class is primarily designed for FRC although it is also applicable for FTC because our TRC Library is shared between FTC and FRC. After finishing this class, you should be able to write code for both FTC and FRC robots with some platform specific differences.
Programming Software Installation
Before coming to the programming class, you need to install the required software on your laptop. Please do this at home before coming to class. We do not want to dedicate class time to install software because they are time consuming and require downloading gigabytes of data from the Internet which would overwhelm our Internet bandwidth if all students were downloading at the same time. Therefore, please make sure you finish these tasks at home before coming to class.
TeleOp Driving Your Robot Right Out-Of-The-Box
At this point, you should have installed all necessary software for developing robot code and also clone the robot template code from the GitHub repo. Since the template already contains basic code for three different kinds of robot base (Differential Drive, Mecanum Drive and Swerve Drive), it takes very few modifications to make it work with any of the three types of robots.
Creating Subsystems
Once the drive base is fully operational, the next step is to create subsystems for the robot such as Elevator, Arm, Intake, Grabber etc. It is a good practice to create subsystems as separate Java classes that encapsulate all hardware related to those subsystems. To create a subsystem, you need to determine the following:
- What hardware does the subsystem contain? This includes motors, actuators and sensors. For example, an elevator will most likely contain a motor to move it up and down, an encoder to keep track of its position and one or two limit switches to tell if the elevator has reached its lower or upper height limit.
- What operations does the subsystem support? For example, an elevator may have a method to allow the joystick to control it going up and down at various speed, a method to command the elevator to go to a certain height, and a method to command the elevator to go to next preset height up or down.
Even though the game of each season changes, a lot of subsystems repeat themselves season after season. Therefore, our Framework Library generalizes and provides these subsystems to handle any generic use. Here are some typical subsystems you will find on a robot.
- Motor Actuators
- Elevator
- Slide
- Arm
- Turret
- Intake
- Conveyor
- Shooter
- Grabber
Connecting Subsystems to the Robot
- Instantiate the subsystems
- TeleOp control of the subsystems
- Display subsystem status