Skip to content

Utilities Everywhere

CoreControl provides a collection of utility classes and functions designed to simplify common FTC programming tasks. This includes global access to SDK objects like Telemetry and HardwareMap, as well as mathematical helpers and debugging tools.

CoreControl automatically injects common SDK objects into global variables when an OpMode starts. This allows you to access them from anywhere in your code—inside Modules, Commands, or utility classes—without passing them around as parameters.

Use hardwareMapEverywhere to initialize your hardware in your modules without passing the hardwareMap object around.

object Intake : Module() {
private lateinit var motor: DcMotor
override fun onInit() {
// Access hardwareMap globally
motor = hardwareMapEverywhere.get(DcMotor::class.java, "intake")
}
}

Use telemetryEverywhere to send data to the Driver Station from anywhere in your code.

fun someFunction() {
telemetryEverywhere.addData("Status", "Running")
// Note: You generally don't need to call update() manually,
// as the OpMode handles it.
}

Access the current time (since the start of the OpMode) globally.

val currentTime = nowMs // Time in milliseconds
val currentTimeSeconds = nowS // Time in seconds

CoreControl also provides some utility functions and classes to assist with common tasks.

A simple implementation of a low-pass filter for smoothing sensor data. This is useful for reducing noise in sensor readings.

val filter = LowPassFilter(alpha = 0.5) // 0.0 to 1.0 (higher is smoother but more lag)
val smoothedValue = filter.filterValue(sensorInput)

A wrapper around Thread.sleep that also logs a message to telemetry. This is useful for debugging or simple delays where blocking the thread is acceptable (e.g., during initialization).

globalSleep(1000, "Waiting for sensor initialization")