Skip to content

vexide/vexide

Repository files navigation

vexide

Open-source Rust runtime for VEX robots. vexide provides a safe and efficient set of APIs and tools for programming VEX robots in Rust!

Getting Started

vexide is published on crates.io and can be used like a normal Rust crate.

If you're just getting started, we recommend going through our docs, which provide step-by-step instructions for setting up a development environment with vexide-template. You can also use our examples as a reference for your own projects.

Project Structure

The vexide runtime is a fairly standard rust monorepo split into 5 subcrates:

  • vexide-core provides common low-level system APIs, such as competition control, synchronization primitives, and backtrace collection.
  • vexide-devices provides APIs for all VEX peripherals and hardware, allowing you to control motors and sensors from Rust code.
  • vexide-async implements vexide's async executor and runtime, as well as a few common futures.
  • vexide-startup contains bare-metal runtime initialization code for booting a freestanding vexide program on the V5 brain.
  • vexide-macro implements the #[vexide::main] proc-macro.

These subcrates are exported from a single vexide crate intended to be used as a complete package.

Building

vexide relies on some features that are only available in Rust’s nightly release channel, so you’ll need to switch to using nightly. We also depend on the rust-src component due to our embedded target requiring a build of core.

rustup override set nightly
rustup component add rust-src

This project is compiled like any other Rust project with one caveat - we have our own dedicated wrapper over cargo called cargo-v5, which wraps the normal cargo build command and allows for uploading to a VEX brain over USB.

You can install that tool with the following command:

cargo install cargo-v5

From there, the project can be built like any other Rust library through cargo-v5:

cargo v5 build --release

Examples can similarly be built this way:

cargo v5 build --example basic --release

Note

Using cargo-v5 is optional if you just want to test if your changes compile. In order to upload programs or examples, you will need to use cargo-v5.

Testing Your Changes

When making changes to vexide, it's a good idea to test them. The easiest way to do this is by running one of our examples. cargo-v5 can be used to upload an example by running a command like this:

cargo v5 upload --example basic --release

Depending on what you have changed, the basic example may not be the best example to test. We have many examples covering different parts of vexide, so choose the one that applies to your changes. If there isn't one, feel free to add it!

About

Open-source Rust runtime for VEX robots.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 17

Languages