Skip to content

hytech-racing/drivebrain_software_2026

Repository files navigation

DriveBrain Software

This repo contains the main executable that runs on the Drivebrain embedded computer on HyTech Racing's cars. This code is deployed as a systemd service onto the car within HyTech's Raspberry Pi NixOS description. This service handles, among other things:

  • high-performance control algorithm execution from both hand written c++ and MATLAB Simulink generated code c++
  • car state estimation via both hand written c++ and MATLAB Simulink generated code c++
  • Vectornav INS communication via Vectornav's driver
  • live telemetry and data recording of all on-car inter-board communications (CAN and Ethernet mostly)
  • car-level parameter servicing of all previously listed components via the integrated Foxglove websocket server

This is an active rewrite of an older iteration of Drivebrain, which you can find here.

Development

This guide explains how to build the DriveBrain Software 2026 using the provided Docker cross-compilation environment.

Prerequisites

  • Docker installed on your system
  • Local clone of the DriveBrain repository

Building the Software

0. Build the dockerfile (you only need to do this once)

Run the following command to build the dockerfile:

docker build -t kkittur/drivebrain_cross_compile .

It may take a few minutes.

1. Enter the Docker Container

Run the following command to start and enter the Docker container with the necessary volumes mounted:

docker compose run dev

Alternatively, if you want to enter a modified container for whatever reason, you can run:

# running with modified memory and cpu limits
docker run -it \
  --mount type=volume,source=conan_cache,target=/root/.conan2 \
  --mount type=bind,source="$(pwd)",target=/app \
  --memory=16g \
  --cpus=4 \ 
  -w /app \
  kkittur/drivebrain_cross_compile /bin/bash 

and pass in whatever flags you see fit.

2. Run the Build Script

Inside the container, execute:

./build_script.sh

This script will build the DriveBrain software using the cross-compilation toolchain for the target platform. The first time you run it, it will take some time because it needs to compile all the dependencies. However, future builds past the first one take <1 minute because dependencies are cached.

Unit Tests

Unit tests have to be compiled to your native architecture if you actually want to see them run. To do this, you can pass in the --test flag in the build script.

./build_script.sh --test

and the project along with its unit tests will be compiled and ran.

Notes

  • Make sure the build script has execute permissions: chmod +x build_script.sh.
  • The build artifacts will be generated inside an autogenerated folder that's handled by Docker. You can access these artifacts for debugging by using docker volume inspect.

About

Contains software for the 2026 revision of Drivebrain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published