Class CharacterizerOpMode
java.lang.Object
com.qualcomm.robotcore.eventloop.opmode.OpMode
com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
com.crossbotics.ftchelper.finders.FinderOpMode
com.crossbotics.ftchelper.finders.CharacterizerOpMode
Measures how the real robot moves, so the simulator (and your code) can use real numbers: for the
drivetrain, each lift or arm, and each flywheel, it finds the feedforward numbers (kS = power to start
moving, kV = power per speed, kA = power per speeding-up, kG = power to hold a lift) and how fast a
flywheel coasts down. It gives each motor slow ramps of power and quick steps, logs the battery,
power and speed, and fits the numbers (see CharacterizeMath).
D-pad up/down = choose a test, A = run it, B = stop it now. Drive: ramps forward then back, then quick steps. About 5 ft clear in FRONT and BEHIND. Turn: turns in place both ways (needs the IMU). Each lift/arm from mechanisms(): start it at the BOTTOM. It moves between your soft limits. Each flywheel: spins up slowly, coasts, spins up fast, coasts. Hands and pieces away.The results are lines for the simulator's robot file and Feedforward lines for your code; they are saved with the other finders' results. Each test's log is saved too (characterizer/*.csv in the same folder) for the simulator's fit tool. In your TeamCode:
@TeleOp(name = "Characterizer", group = "Finders")
public class Characterizer extends CharacterizerOpMode {
protected RobotConfig robotConfig() { return new RobotSettings(); }
protected List<Mechanism> mechanisms() {
return Arrays.asList(Mechanism.lift("lift", 0, 2700), Mechanism.flywheel("flywheel"));
}
}
Docs: docs/modules/finders.md ("Characterizer"). Guide: docs/guides/simulator.md ("Real numbers")-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA lift, arm or flywheel to measure. -
Field Summary
FieldsModifier and TypeFieldDescriptioncom.qualcomm.robotcore.hardware.Gamepadcom.qualcomm.robotcore.hardware.Gamepadcom.qualcomm.robotcore.hardware.HardwareMapstatic final intintDeprecated.org.firstinspires.ftc.robotcore.external.TelemetryFields inherited from class com.crossbotics.ftchelper.finders.FinderOpMode
results, tFields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode
blackboard, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidBinds gamepad 1 buttons.protected doubleThe highest power the drive and turn ramps reach (default 0.4, at most 0.5).protected StringThe finder's name, e.g.protected String[]The help page: every button and the steps, a line each (at most 13 lines, about 50 characters each, to fit on the Driver Station).protected intThe farthest the drive test may roll in one go, in wheel counts (default 2500: about 4.5 ft with 312 rpm motors and 104 mm wheels; fewer feet with smaller counts per inch).protected List<CharacterizerOpMode.Mechanism> The lifts, arms and flywheels to measure.final voidprotected abstract RobotConfigYour robot's settings (drive motors, IMU).protected voidsetup()Sets up the hardware, in INIT.protected voidThe finder's own screen lines, every loop.protected voidWhat INIT shows (the controls, a safety note).protected voidstep()Runs once every loop after the buttons: moves things, measures.protected voidstopAll()Stops every motor and servo it moves.Methods inherited from class com.crossbotics.ftchelper.finders.FinderOpMode
helpKeyDown, inputsReady, openHelp, pause, runOpModeMethods inherited from class com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
idle, init, init_loop, isStarted, isStopRequested, loop, opModeInInit, opModeIsActive, sleep, start, stop, waitForStartMethods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode
getRuntime, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, resetRuntime, terminateOpModeNow, updateTelemetry
-
Field Details
-
MS_BEFORE_FORCE_STOP_AFTER_STOP_REQUESTED
public static final int MS_BEFORE_FORCE_STOP_AFTER_STOP_REQUESTED- See Also:
-
gamepad1
public volatile com.qualcomm.robotcore.hardware.Gamepad gamepad1 -
gamepad2
public volatile com.qualcomm.robotcore.hardware.Gamepad gamepad2 -
telemetry
public org.firstinspires.ftc.robotcore.external.Telemetry telemetry -
hardwareMap
public volatile com.qualcomm.robotcore.hardware.HardwareMap hardwareMap -
msStuckDetectStop
Deprecated.
-
-
Constructor Details
-
CharacterizerOpMode
public CharacterizerOpMode()
-
-
Method Details
-
robotConfig
Your robot's settings (drive motors, IMU). -
mechanisms
The lifts, arms and flywheels to measure. Default: none (drive and turn only). -
driveRampMax
protected double driveRampMax()The highest power the drive and turn ramps reach (default 0.4, at most 0.5). Lower it for a small space. -
maxDriveCounts
protected int maxDriveCounts()The farthest the drive test may roll in one go, in wheel counts (default 2500: about 4.5 ft with 312 rpm motors and 104 mm wheels; fewer feet with smaller counts per inch). A ramp or step that gets this far ends early. Lower it for a small space. -
finderName
Description copied from class:FinderOpModeThe finder's name, e.g. "Servo finder".- Specified by:
finderNamein classFinderOpMode
-
setup
protected void setup()Description copied from class:FinderOpModeSets up the hardware, in INIT. Nothing may move here.- Specified by:
setupin classFinderOpMode
-
showInit
Description copied from class:FinderOpModeWhat INIT shows (the controls, a safety note).- Overrides:
showInitin classFinderOpMode
-
helpLines
Description copied from class:FinderOpModeThe help page: every button and the steps, a line each (at most 13 lines, about 50 characters each, to fit on the Driver Station). GUIDE (or START held 1 s) shows it, in INIT or while running. Default: a page that says there is no help yet.- Overrides:
helpLinesin classFinderOpMode
-
bind
Description copied from class:FinderOpModeBinds gamepad 1 buttons. Actions must be quick: never wait.- Specified by:
bindin classFinderOpMode
-
step
protected void step()Description copied from class:FinderOpModeRuns once every loop after the buttons: moves things, measures. Never waits.- Specified by:
stepin classFinderOpMode
-
show
Description copied from class:FinderOpModeThe finder's own screen lines, every loop.- Specified by:
showin classFinderOpMode
-
stopAll
protected void stopAll()Description copied from class:FinderOpModeStops every motor and servo it moves. Called at the end, always.- Specified by:
stopAllin classFinderOpMode
-
requestOpModeStop
public final void requestOpModeStop()
-