Skip to content

Prerequisites

Before we get started with the guide, there are a few things that you should already be familiar with. You don’t need to be an expert in all of these, but you should have at least some experience with most of them.

  • Some type of programming experience. It doesn’t matter what language, but you should have at least some experience with programming in general. It will be easier if it is something like Rust, C or C++, but experience with Python will still be helpful. (Block-coding will not be sufficient btw)

  • Basic knowledge about you robot is necessary. You should know what motors, sensors, and other components you have on your robot, and how to connect them to the brain.

Now, if you have experience with all of these, great! You should be able to follow the guide without too much trouble. If you are missing one or more of these, don’t worry! You can still follow the guide, but you may need to do some additional research or learning on the side to fill in the gaps. I will try to provide links to resources that can help you with that, but it will be up to you to do the learning. If you have any questions or need help, feel free to reach out to me on my github profile. Now, let’s get started with the rest of the guide!

In order to use Vexide, you’ll need a Rust toolchain (cargo, rustc, etc…) installed on your computer. To install Rust on your system, follow the instructions here.

Just using cargo:

Terminal window
cargo install cargo-v5

but if you have Cargo Binstall:

Terminal window
cargo binstall cargo-v5

To start a new project, run the following command in your terminal:

Terminal window
cargo v5 new my_project

After running this, you should have a new folder named my-project (or whatever you named your project). Open that folder in a code editor of your choice. If you don’t have a code editor, we recommend starting with Visual Studio Code or Zed.

template project open in a text editor editor

If you’ve worked in a rust project before, this file structure should be somewhat familiar to you.

  • Directorymy_project
    • Directory.cargo
      • config.toml
    • Directory.github
      • Directoryworkflows
        • rust.yml
    • Directorysrc
      • main.rs The entrypoint file of your program’s source code.
    • .envrc
    • .gitignore
    • Cargo.lock
    • Cargo.toml Your project’s package information, including its dependencies.
    • README.md
    • flake.nix
    • rust-toolchain.toml

Good, now we have a generic Vexide Project. Next, we will be looking into how to modify it using Antaeus to make it work for our robot. Antaeus is available on crates.io, so you can easily add it using a single command:

Terminal window
cargo add antaeus

or you can add it manually to your Cargo.toml file:

[dependencies]
antaeus = "0.3.8"