This is a template repository for FRC teams, designed to provide a starting point for projects using the frcrs framework. The template includes a basic structure to get you started with defining subsystems, configuring inputs, and handling commands in your robot code.
Before using this template, make sure you have the following:
- rust and the toolchain
arm-unknown-linux-gnueabi
- RoboRIO toolchain
git clone https://github.com/wpilibsuite/allwpilib
cd allwpilib
./gradlew installRoboRioToolchain
- add to path
~/.gradle/toolchains/frc/2024/roborio/bin
Clone the repository:
git clone https://github.com/Team-2502/frcrs-template.git
cd frcrs-template
cargo build --release --target arm-unknown-linux-gnueabi
download from https://github.com/Team-2502/frcrs/releases
or build from frcrs
- use deploy from frcrs
https://github.com/Team-2502/frcrs/tree/jni/deploy
If you need to copy javastubdeploy --team-number TEAM --executable target/arm-unknown-linux-gnueabi/debug/robotcode
deploy --team-number TEAM --executable target/arm-unknown-linux-gnueabi/debug/robotcode --lib /path/to/javastub.jar
- Manual
scp target/arm-unknown-linux-gnueabi/debug/robotcode [email protected]:.
set /home/lvuser/robotCommand to JAVA_HOME=/usr/local/frc/JRE /home/lvuser/robotcode
This template provides a basic setup for your robot code. Here’s how to get started:
The configure
function is where you should declare subsystems, joysticks, or any other components that need to be initialized on startup.
use frcrs::container;
pub struct Ferris;
pub async fn configure() {
container!(container, Ferris {});
}
In this example, Ferris
is a placeholder for your robot's struct. You can replace it with your actual struct that represents the robot or its subsystems.
The container
function is where you'll put your robot's commands. This function will be called in a loop, which by default is capped at 500Hz.
pub async fn container() {
// Add your commands here
}