Package com.crossbotics.ftchelper.core
Class RobotConfig
java.lang.Object
com.crossbotics.ftchelper.core.RobotConfig
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 -
Method Summary
Modifier and TypeMethodDescriptionauto()Autonomous tuning (wheel size, encoder counts, ...).abstract DriveConfigdrive()The drivetrain: type, motor names, directions, power limit.abstract com.qualcomm.robotcore.hardware.IMUimu(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap) The IMU (turn sensor), set up for how the hub is mounted.
-
Constructor Details
-
RobotConfig
public RobotConfig()
-
-
Method Details
-
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
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 oneImuSetup.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.)
-