Ready-to-use template for developing VEX V5 robots in Rust.
Seasoned Vexide user? Delete README.md and update Cargo.toml as needed.
- Vexide Template
To start a project using this template, click the "Use this template" button in the upper right corner of the GitHub repository. Choose an appropriate name and clone the new repository using Git. Finally, update the package name in Cargo.toml
:
[package]
name = "my-vex-robot"
version = "0.1.0"
edition = "2021"
Install Rust by following the instructions on https://rustup.rs/.
Run the following commands in Powershell to set up your PC for development on Windows.
-
Install Python 3.9:
winget install -s msstore "Python 3.9"
-
Close and reopen the terminal, and finish installing Vexide:
pip3.9 install --user pros-cli rustup default nightly rustup component add rust-src llvm-tools-preview cargo install cargo-pros cargo-binutils
Run the following terminal commands to set up your Mac for development.
-
Install Homebrew, a package manager for macOS:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Under the header "Next Steps", Homebrew may prompt you to run commands to complete the installation.
-
Install Rust and PROS:
brew install rustup [email protected] rustup-init -y --default-toolchain nightly pip3.10 install pros-cli
-
Close and reopen the terminal, and finish installing Vexide:
rustup component add rust-src llvm-tools-preview cargo install cargo-pros cargo-binutils
The Nix flake includes a devshell with every tool you need for building and uploading vexide projects.
You still need to run rustup component add llvm-tools-preview
if you haven't already.
There is a .envrc
file for Nix + Direnv users.
Run the following terminal commands to set up your PC for development on Debian or Ubuntu.
-
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install Python 3.9 and PROS:
sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.9 python3-pip python3.9-distutils python3.9 -m pip install --user pros
-
Close and reopen the terminal, and finish installing Vexide:
rustup default nightly rustup component add rust-src llvm-tools-preview cargo install cargo-pros cargo-binutils
Run the following terminal commands to set up your PC for development on Fedora.
-
Install Rust and PROS:
sudo dnf install rustup python3-pip rustup-init -y --default-toolchain nightly pip install --user pros-cli
-
Close and reopen the terminal, and finish installing Vexide:
rustup component add rust-src llvm-tools-preview cargo install cargo-pros cargo-binutils
Use the Cargo PROS terminal utility to build and upload this Vexide project.
cargo pros build
Use a USB cable to connect to your robot brain or to your controller before using the upload
subcommand to build and upload the project. Make sure to specify a program slot.
cargo pros upload --slot 1
You can view panic messages and calls to println!()
using the PROS terminal.
Use a USB cable to connect to your robot brain or controller, then start the terminal:
pros terminal --raw
Developers using Visual Studio Code with the rust-analyzer extension have access to smart editing features like Intellisense and code analysis. By default, rust-analyzer will check the project for errors when it is saved.
- If you get the error
TypeError: <flag 'BrainFlags'> has no members defined
when using the third partypros upload
command, you need to downgrade Python to v3.9