https://github.com/snidercs/frc-bot-2024
https://github.com/snidercs/frc-bot-2024
frc-c-plus-plus frc-lua frc-robot
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/snidercs/frc-bot-2024
- Owner: snidercs
- License: other
- Created: 2024-01-28T00:53:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-02T20:08:00.000Z (over 1 year ago)
- Last Synced: 2025-01-02T20:27:18.466Z (over 1 year ago)
- Topics: frc-c-plus-plus, frc-lua, frc-robot
- Language: C++
- Homepage: https://snidercs.org/robot
- Size: 1.29 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/snidercs/bot-2024/actions/workflows/build.yml)
# Robot Firmware FRC 2024
## Features
- Built-in Lua interpreter.
- Smart bot configuration with Lua bindings and negligible overhead.
- Fast code deploys when c++ doesn't need recompiled.
- Ultra low latency performance.
- Design is decoupled from wpilib making it portable to other robotics systems.
## Clone
```bash
git clone --recursive git@github.com:snidercs/bot-2024.git
```
## Clang Format
The c++ code should be formatted before submitting pull requests. Do this with python or gradle.
```bash
# Run the python script directly
python3 util/format.py
# or do it wrapped in a gradle task
./gradlew clangFormat
```
## Requirements
### Dependencies
The `gradle build` and `gradle deploy` tasks both need roboRIO libraries and headers in place. Most of them are handled by wpilib, but some need special attention.
Note: For _Windows_ GitBash and the CMD prompt are both needed.
#### LuaJIT
The build requires LuaJIT, which WPIlib does not provide. It must be compiled manually.
**Linux**
```bash
# multilib support is needed for cross building, install if needed
sudo apt-get install gcc-multilib g++-multilib
# Run the native/roborio build scripts
util/build-luajit-linux64.sh
util/build-luajit-roborio.sh
```
**macOS**
Make sure you have an amd64 version of container
```bash
docker build . -t snidercs/bot-2024 --platform=linux/amd64
```
The Mac build script can produce `arm64` or `x86_64` binaries. It will select the system default if not specified.
```bash
util/build-luajit-macos.sh # Builds for both arm64 and x86_64
# Docker is required for roboRio builds/deploys
util/docker-run.sh util/build-luajit-roborio.sh
```
**Windows**
The build script can be run from a **GitBash** terminal:
```bash
# In a bash emulator
util/build-luajit-msvc.sh
```
The roboRIO binaries need docker to compile from Windows which _requires_ a regular **CMD prompt**:
```
util\docker-run.bat util/build-luajit-roborio.sh
```
### Firmware Build with WPIlib VSCode
After LuaJIT is compiled, open a terminal and do:
```bash
./gradlew build
```
This will make roboRio binaries to be deployed
### Firmware With Docker
```bash
./dockerbuild.sh
```
## Testing
Run all unit tests.
```bash
./gradlew check
```
## Deployment
Run the following command to deploy code to the roboRIO
```bash
./gradlew deploy
```
If it gives problems, cleaning the project could help. The `--info` option could give more information too.
```bash
./gradlew clean
./gradlew deploy --info
```