Robot Parameters - Pattonville-Robotics/2866 GitHub Wiki

The RobotParameters class

Class Structure

The RobotParameters class is used to store all useful unique information about a team's robot. In order to use the same Common-Code classes for all three teams, we developed a descriptor that would be used by the EncoderDrive class. To construct instances of this class, we use a Builder pattern to set many optional fields.

Data

The robot has several values programmed into it. We use this data to accurately track the robot's position using various sensors. The encoders in the robot's motors can track exactly how many inches the robot has gone. By taking these values and the encoders' value, we can determine values like how fast the robot moves, how fast the robot processes orders in relation to speed (by taking ticks per revolution and degree) and how fast the robot moves per tick.

To find the values we followed this procedure:

  1. Make an initial guess for the wheel radius
  2. Move x inches foreward
  3. Measure how many inches were actually moved, y
  4. Multiply the radius guess by x / y

The reason this works is because all functions involved with finding the circumference of the wheel and the distance travelled are linear. Any composition of linear functions is itself a linear function, so we can use a simple ratio to correct the value.

This same system can be used to find the wheel circumference. However, the ratio is the reciprocal of the linear case because there are two levels of circular motion to compute.

Data Value
Wheel Gear Ratio 92 : 42
Wheel Radius 1.52in
Wheelbase Radius 7.59in
Gyro Present
Encoders Present
DC Motor Max Speed 2,880 ticks/s
Right Motor Direction Forward
Left Motor Direction Reverse