Skip to content

Team-2502/frcrs-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frcrs-template

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.

Getting Started

Prerequisites

Before using this template, make sure you have the following:

  1. rust and the toolchain arm-unknown-linux-gnueabi
  2. RoboRIO toolchain
git clone https://github.com/wpilibsuite/allwpilib
cd allwpilib
./gradlew installRoboRioToolchain
  1. add to path ~/.gradle/toolchains/frc/2024/roborio/bin

Installation

Clone the repository:

git clone https://github.com/Team-2502/frcrs-template.git
cd frcrs-template

Running

1. Building robotcode

cargo build --release --target arm-unknown-linux-gnueabi

2. copy javastub binary to RIO (only done once per rio)

download from https://github.com/Team-2502/frcrs/releases or build from frcrs

3. deploy code

  1. use deploy from frcrs https://github.com/Team-2502/frcrs/tree/jni/deploy
    deploy --team-number TEAM --executable target/arm-unknown-linux-gnueabi/debug/robotcode
    If you need to copy javastub
    deploy --team-number TEAM --executable target/arm-unknown-linux-gnueabi/debug/robotcode --lib /path/to/javastub.jar
  2. 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

Usage

This template provides a basic setup for your robot code. Here’s how to get started:

1. Configure the Robot

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.

2. Define Commands

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
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published