Giter VIP home page Giter VIP logo


BazelRIO

A collection of bazel utilities for FRC

Installation

You can include BazelRIO in your project like so:

http_archive(
    name = "bazelrio",
    url = "https://github.com/bazelRio/bazelRio/archive/refs/tags/0.10.0.zip",
    sha256 = "18b109dbd5204910600823e6c9ff405fa7ed7c43d0a78f24077f8187311745a9",
    strip_prefix = "bazelRio-0.10.0/bazelrio",
)

load("@bazelrio//:deps.bzl", "setup_bazelrio_dependencies")

setup_bazelrio_dependencies()

load("@bazelrio//:defs.bzl", "setup_bazelrio")

setup_bazelrio()

You must copy the .bazelrc file from the C++ or Java example into your project workspace and update your BUILD and WORKSPACE files in the same fashion.

Features

Support matrix

Language Compilation Simulation Deployment
C++ 🟢 🟢 🟢
Java 🟢 🔴 🟢
Kotlin 🟢 🔴 🟢
Python 🔴 🔴 🔴

Cross compilation

BazelRIO provides a RoboRIO target for easy cross-compilation.

bazel build <target> --platforms=@bazelrio//platforms/roborio

BazelRIO will automatically download an official roboRIO toolchain (from WPILib) for your host OS and use it.

Robot code rules

BazelRIO provides rules for robot code targets of multiple languages.

C++

load("@bazelrio//:defs.bzl", "robot_cc_binary")

robot_cc_binary(
    name = "hello",
    team_number = 1337,
    srcs = ["hello.cpp"],
)

BazelRIO will create a cc_binary target named hello, as well as a special target named hello.deploy that can be used to deploy your binary:

bazel run //:hello.deploy --platforms=@bazelrio//platforms/roborio
...
Attempting to connect to roborio-1337-frc.local...
Connected to roborio-1337-frc.local.
Attempting to deploy bazel-out/darwin-fastbuild/bin/hello...
Deployed bazel-out/darwin-fastbuild/bin/hello. Exiting.

Java / Kotlin

robot_java_binary(
    name = "hello",
    main_class = "frc.robot.Main",
    team_number = 1337,
    runtime_deps = [
        "//src/main/java/frc/robot",
    ],
)

BazelRIO will create a java_binary target named hello, as well as a special target named hello.deploy that can be used to deploy your binary. If you are using Kotlin, you must build your code as a kt_jvm_library and add it to runtime_deps, rather than adding Kotlin files directly to srcs.

Libraries

BazelRIO containts library targets for WPILib and some vendor libraries:

  • @bazelrio//libraries/cpp/wpilib/wpilibc
  • @bazelrio//libraries/java/wpilib/wpilibj
  • @bazelrio//libraries/cpp/ctre/phoenix
  • @bazelrio//libraries/cpp/rev/sparkmax
  • @bazelrio//libraries/cpp/rev/revlib
  • @bazelrio//libraries/cpp/rev/colorsensor
  • @bazelrio//libraries/cpp/kauailabs/navx

Simulations

Simulations (alongside halsim extensions) are supported! Take a look at the C++ example to get started.

bazelrio's Projects

bazelrio icon bazelrio

Bazel workflows for the roboRIO and WPILib

pathweaver icon pathweaver

Desktop application for generating motion paths

sysid icon sysid

System identification for robot mechanisms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.