frcrs
frcrs is a robotics control framework designed to streamline the development of control systems for FRC robots. It provides a highly modular architecture, focusing on creating independent and reusable subsystems to simplify the overall control structure of the robot.
Features
- Modular Subsystem Structure: Each robot subsystem (e.g., Drivetrain, Shooter) is separated into individual modules, promoting clean, maintainable code.
- Easy Integration: Easily integrate into a runnable robot, will build with no hassle
- Asynchronous: Asynchronous tasks, allowing efficient control of subsystems in real-time scenarios.
Subsystem Overview
The main design principle of frcrs is to split robot functionality into independent subsystems. Each subsystem is responsible for controlling a specific part of the robot, such as the drivetrain, shooter, or intake mechanism.
- Subsystems: Implemented using Rust structs, subsystems encapsulate the hardware interface and logic for a specific component of the robot.
- Controllers: Subsystems are controlled via Joystick or other input mechanisms, which can be passed into the subsystems as needed.
- Communication: Subsystems communicate with each other through shared ownership patterns, using Rc<RefCell<>> to manage state in a safe and efficient way.
Example Usage
Here’s an example of how a subsystem might be implemented in frcrs:
use SRX;
use crateconstants;
See an example here
Getting Started
- Clone the Repository
- Ensure that you have Rust and cargo installed. You can install Rust here
- Install Java 17, the same for FRC
- Install rust target
- Install toolchain
- Add directory to path
$HOME/.gradle/toolchains/frc/YYYY/roborio/binwhereYYYYis the year of the toolchain - Build frcrs with
cargo build --release --target arm-unknown-linux-gnueabi - Create robotcode, see an example here
- Deploy your code, see deploy crate for deployment. An example toml is here
[] = 2502 = "target/arm-unknown-linux-gnueabi/release/robotcode" = "javastub.jar" = "talon-board/out" = "/home/lvuser/talon-board/out"
Contributing
We welcome contributions! If you have suggestions for improvements or find bugs, feel free to create an issue or submit a pull request.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.