Hello Robot - Robot Control
With the basics of controlling actuators and getting feedback from sensors is understood from Hello Robot - Test Bed, it is time to start configuring and programming our robot for Teleoperated and Autonomous control!
Before continuing it is recommended to complete, at minimum, a drivetrain. There are a few different options depending on the kit being used. For this guide the Class Bot V2 is used. Check out the build guide for full building instructions for the Class Bot V2!
The graphic below highlights the major hardware components of the Class Bot V2. These components are important to understand for the configuration process.
The Hello Robot - Configuration section focused on configuring the components in the Test Bed. In order to continue forward with the Robot Control programming sections, a new configuration file must be made for the components on the robot. It is your choice what variable names you would like to assign to your robot, but for reference this guide will use the following names for each hardware component.
Before continuing it is important to understand the mechanical behavior of different drivetrains. The two most common drivetrain categories types are Differential and Omnidirectional. The Class Bot's drivetrain is a differential drivetrain. The table below highlights the main features of these two types of drivetrains.
There are a number of different ways to control a robot teleoperated. When using the REV Control System this is done with a Driver Station Device and gamepads. There are various ways to use a controller to drive a differential drivetrain. Two of the conventional ways are Tank Drive and Arcade Drive.
For tank drive, each side of the differential drivetrain is mapped to its own joystick. Changing the position of each joystick allows the drivetrain to steer and change its heading. Sample code exists in the Robot Controller Application to control a differential drivetrain in this way.
For arcade drive, each side of the differential drivetrain is controlled by a single joystick. Changing position of the joystick changes the power applied to each side of the drivetrain allowing for a given command. Arcade drives typically have left/right movement of the joystick set to spin the robot about its axis with forward/back moving the robot forward and reverse. More information on Arcade drive are found in the Robot Navigation - Blocks and Robot Navigation - OnBot Java sections.
With the robot configured, a basic understanding of drivetrains, and teleoperated control types, we can move forward to programming the drivetrain to get the robot moving.