safe-vex

Crates.iosafe-vex
lib.rssafe-vex
version3.2.2-experimental
sourcesrc
created_at2023-11-13 07:04:43.559734
updated_at2024-05-13 13:00:48.473814
descriptionA modular, reliable and comprehensive wrapper around the vex-rt library that never crashes.
homepage
repositoryhttps://github.com/GreenChild04/safe-vex
max_upload_size
id1033343
size35,793
(GreenChild04)

documentation

README

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
Commit count: 53

cargo fmt