Class RobotConfig

java.lang.Object
com.crossbotics.ftchelper.core.RobotConfig

public abstract class RobotConfig extends Object
The robot's drivetrain described ONCE: motor names and directions, autonomous tuning, and how the Control Hub is mounted. EasyTeleOp and EasyAuto both read it, so TeleOp and every autonomous always match. Change a motor name here and every program gets it.

 public class RobotSettings extends RobotConfig {
     @Override public DriveConfig drive() {
         DriveConfig c = DriveConfig.mecanum();
         c.frontLeft = "front_left";   // ... the other names
         return c;
     }
     @Override public AutoDriveConfig auto() { ... }     // optional: only for autonomous
     @Override public IMU imu(HardwareMap hardwareMap) {
         return ImuSetup.get(hardwareMap, "imu", LogoFacingDirection.UP, UsbFacingDirection.FORWARD);
     }
 }
 

The mechanisms (lift, claw, ...) are not in here: they go in your own Robot class (see docs/starter-kit.md), because your programs need to reach them by name.

"abstract" means you cannot use this class as it is: you make your own class that extends it and fills in the methods marked abstract. Docs: docs/modules/core.md (section "RobotConfig")

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Autonomous tuning (wheel size, encoder counts, ...).
    abstract DriveConfig
    The drivetrain: type, motor names, directions, power limit.
    abstract com.qualcomm.robotcore.hardware.IMU
    imu(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap)
    The IMU (turn sensor), set up for how the hub is mounted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RobotConfig

      public RobotConfig()
  • Method Details

    • drive

      public abstract DriveConfig drive()
      The drivetrain: type, motor names, directions, power limit. It may be called more than once per program: make a fresh DriveConfig each time.
    • auto

      public AutoDriveConfig auto()
      Autonomous tuning (wheel size, encoder counts, ...). Only autonomous uses it. The default is an untuned config, which autonomous refuses to run with, on purpose, until you tune it (tutorial 09).
    • imu

      public abstract com.qualcomm.robotcore.hardware.IMU imu(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap)
      The IMU (turn sensor), set up for how the hub is mounted. Usually one ImuSetup.get(...) line. Every Control Hub has one, so return it. (Returning null means "no IMU": TeleOp then drives robot-centric only, and autonomous refuses to start, because its turns need the IMU.)