safe-vex
A modular, safe and data-orientated rust wrapper over the Purdue PROS library for Vex Robotics
Disclamer
safe-vex is an open-source project by kalscium. safe-vex is neither endorsed by or affiliated with Innovation First, Inc. VEX and VEX Robotics are trademarks or service marks of Innovation First, Inc. safe-vex is also not developed by nor endorsed by the developers of the Purdue PROS library.
Quickstart (Nix)
you will need:
- nix
- nix flakes
then:
- Clone the
safe-vexproject template by running the following command:
- Enter the newly cloned directory
- Enter the nix dev-environment with
- Turn on and connect to the vex v5 brain
- Give permission to upload code to the robot with: (doesn't matter if this fails)
||
- While connected to the v5 brain run:
- Your robot should now be up and running :D
Quickstart (Debian)
you will need:
- A rust toolchain managed by
rustup: - An
arm-none-eabitoolchain gccandlibclang-dev/libclang- (optional)
libc6-devif rustc is throwing the error:
/usr/lib/arm-none-eabi/include/sys/reent.h:14:10: fatal error: 'stddef.h' file not found
thread 'main' panicked at /home/dev/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vex-rt-0.15.1/build/main.rs:266:10:
Could not generate bindings.: ClangDiagnostic("/usr/lib/arm-none-eabi/include/sys/reent.h:14:10: fatal error: 'stddef.h' file not found\n")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
- The
pros-cliinstalled throughpip
then:
- Clone the
safe-vexproject template by running the following command:
- Enter the newly cloned directory
- Turn on and connect to the vex v5 brain
- Give permission to upload code to the robot with: (doesn't matter if this fails)
||
- While connected to the v5 brain run:
- Your robot should now be up and running :D
Updating the PROS Library Version
(For future reference for the maintainence of this library) To update the pros library version used by
safe-vex, follow the following steps (with the correct toolchains installed)
- Enter the
builddirectory of the library
While inside the build dir
- Create an empty pros project
- Delete the unnecessary bloat libraries and files that are irrelevant to
PROS
- Rename the
project.prosfile totemplate.prosand take note of the version
- Zip and package the kernel for compilation use
( && )
- Update references to the kernel package in bindgen build code (still in the build dir
main.rs)
// Path to PROS release zip (relative to project root)
const PROS_ZIP_STR: &str = "build/kernel@VERSION.zip"; // update the vesrion
In the project root
- Clean the project and publish it (given you have changed the project version in
Cargo.tomlto something appropriate to this update to the kernel)