- Rust 100%
* wip: add `confetti setup` command to download WPILib (still needs to install) * refactor: rename subcommand to `install` * feat: add command to download toolchain archive * feat: extract toolchain to ~/.confetti * feat: set toolchain installation in cargo config * perf: use steady tick for progress spinners * fix: add case for when target.arm-unknown-linux-gnueabi is unset * feat: set toolchain up locally by default * fix: make toml setup actually work * docs: better description * feat: add note to install toolchain on failed build * refactor: rename installer.rs -> toolchain.rs and clean up code * fix: handle subdirectories in zip file properly * fix: open cargo config file with read permission * style: fix deepsource issues |
||
|---|---|---|
| confetti | ||
| confetti-cli | ||
| examples | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
confetti 🎉
a framework for building FRC robots in Rust
built on guineawheek/wpihal-rs.
contributing
help is more than welcome! even if you're not sure what you can contribute, please let me know or send me an email (my email is on my profile).
if you're familiar with how some of the low-level stuff works, please reach out! i'm learning this as i go, so that would be extremely helpful for me
even if you just have complaints about the API, i'd love to hear em. i'm far from a rust professional
prerequisites
- you need to have WPILib installed. choose "everything" (NOT "tools only").
- download the proper ARM FRC toolchain for your platform from wpilibsuite/opensdk. you're looking for something like "
cortexa9_vfpv3-roborio-academic-2025-YOUR-SYSTEM-TRIPLE-Toolchain-12.1.0.tgz". as of right now, the v2025-2 toolchain is the latest and does compile. - set the
arm-frc202X-linux-gnueabi-gccas the linker for thearm-unknown-linux-gnueabitarget in~/.cargo/config.tomlfile. for example, on my computer:
[target.arm-unknown-linux-gnueabi]
linker = "/Users/te/roborio-toolchain/bin/arm-frc2025-linux-gnueabi-gcc"
- now, when you build, ensure that you use
--target arm-unknown-linux-gnueabi, e.g.cargo build --release --target arm-unknown-linux-gnueabi
example
use confetti::prelude::*;
struct MyRobot {
drivetrain: DifferentialDrive,
}
impl Robot for MyRobot {
fn teleop_periodic(&mut self) {
self.drivetrain.arcade_drive(0.5, 0.25);
}
}
fn main() -> anyhow::Result<()> {
let left = MotorGroup::from_motors(vec![SparkMAX::new(0), SparkMAX::new(1)]);
let right = MotorGroup::from_motors(vec![SparkMAX::new(2), SparkMAX::new(3)]);
let drivetrain = DifferentialDriveBuilder::default()
.left_motor(left)
.right_motor(right)
.build()
.unwrap();
drivetrain.arcade_drive(0.65, 0.2);
let bot = MyRobot { drivetrain };
run(bot)
}
goals
WILL NOT abide by the WPILIB API
there are a lot of things they do that would be bizarre at best to do in Rust (from my understanding). i also don't like it that much anyway
WILL go for feature parity
unfortunately, my team has limited time, people, and resources, so this is largely a personal project and there is very limited hardware available for me to test. implementing hardware is something that i will likely have to rely on others for
WILL go for ease-of-use
i want this library to be approachable for beginner Rust programmers, so i will try hard to make things make sense.
roadmap
- get robot loops to work*
- implement revlib
- implement command-based style framework
- implement wpimath (sigh)
- get CLI in order
- deploy*
- project init
*untested. my team is not particularly rich in money, resources, or time, so getting a hold of a robot that i can test on is difficult, to say the least