NextControl is an open-source control library for the FIRST Tech Challenge. It provides a robust system for creating any controller imaginable.
The docs are at nextftc.dev/control.
Ensure you have a copy of FtcRobotController.
In build.dependencies.gradle, add the dependency:
implementation 'dev.nextftc:control:VERSION'Replace VERSION with the latest version (shown at the top of this README).
Create a PID controller:
Kotlin:
val controlSystem = controlSystem {
posPid(0.005, 0.0, 0.0)
}Java:
ControlSystem controlSystem = ControlSystem.builder()
.posPid(0.005, 0, 0)
.build();Then every loop set your motor power:
Kotlin:
motor.power = controlSystem.calculate(
KineticState(motor.position, motor.velocity)
)Java:
motor.setPower(
controlSystem.calculate(
KineticState(motor.getPosition(),motor.
getVelocity())
)
);For more in-depth usage, read the docs.
- Kotlin - A modern, expressive, statically typed, general-purpose programming language for the JVM developed by JetBrains and sponsored by Google.
- Gradle – Powerful build system for automating compilation, testing, and publishing
- Kotest – Flexible and expressive testing framework for Kotlin
- MockK – Mocking library for Kotlin
Please read our contributing page for details on our code of conduct, and the process for submitting pull requests to us.
We use Semantic Versioning for versioning. For the versions available, see the releases on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the GNU General Public License v3.0
You are free to use, modify, and distribute this software under the terms of the GPLv3. Any derivative work must also be distributed under the same license.
See the LICENSE for more information.