#vex #robot #wrapper #vex-rt #robotics #api-bindings

no-std safe-vex

A modular, reliable and comprehensive wrapper around the vex-rt library that never crashes

38 releases (23 stable)

new 3.2.3-experimental May 15, 2024
2.2.2 Jan 21, 2024
2.2.1 Dec 5, 2023
1.2.0 Dec 2, 2023
0.3.2 Nov 16, 2023

#127 in Hardware support

Download history 42/week @ 2024-02-28 377/week @ 2024-03-06 5/week @ 2024-03-27 6/week @ 2024-04-03 417/week @ 2024-05-01 355/week @ 2024-05-08

772 downloads per month

MIT/Apache

21KB
383 lines

crates.io Downloads crates.io License

safe-vex

A safe, reliable and comprehensive wrapper around the vex-rt library that will never panic!

Disclamer

safe-vex is an open-source community project. 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 the same developers at vex-rt rather it is an independant project.

Quickstart (Natively)

you will need:

  1. A rust toolchain managed by rustup:
  2. An arm-none-eabi toolchain
  3. gcc and libclang-dev/libclang
  4. (optional) libc6-dev if rustc is throwing the error:
--- stderr
/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
  1. The pros-cli installed through pip

then:

  1. Clone the safe-vex project template by running the following command:
git clone https://github.com/GreenChild04/safe-vex-template.git
  1. Enter the newly cloned directory
  2. Turn on and connect to the vex v5 brain
  3. Give permission to upload code to the robot with: (doesn't matter if this fails)
sudo chmod a+rw /dev/ttyACM0 || sudo chmod a+rw /dev/ttyACM1
  1. While connected to the v5 brain run:
cargo run --release
  1. Your robot should now be up and running :D

Quickstart (with Docker)

you will need:

  1. docker

then:

  1. Clone the safe-vex project template by running the following command:
git clone https://github.com/GreenChild04/safe-vex-template.git
  1. Enter the newly cloned directory
  2. Build the docker image with:
docker build -t safe-vex-template
  1. Turn on and connect to the vex v5 brain
  2. Give permission to upload code to the robot with: (doesn't matter if this fails)
sudo chmod a+rw /dev/ttyACM0 || sudo chmod a+rw /dev/ttyACM1
  1. Run the docker container interactively with:
docker run -it --rm --device=/dev/$(ls /dev/ttyACM*) -v .:/project -v $HOME/.cargo/registry:/home/dev/.cargo/registry safe-vex-template
  1. Run cargo run --release in the docker container while connected to the v5 brain
  2. Your robot should now be up and running :D

Dependencies

~25MB
~133K SLoC