Valor 6800 1.0
Loading...
Searching...
No Matches
Valkyrie

Short description

Valkyrie is the C++ robot codebase for the 2026 Valor team. It builds as a native C++ library and includes a Google Test-based test suite and Doxygen documentation generation.

Quickstart

Prerequisites

  • Java JDK 11+ (for Gradle wrapper)
  • Git (to fetch submodules like thrifty-lib)

Build (Windows)

.\gradlew build
.\gradlew test

Build (Unix)

./gradlew build
./gradlew test

Generate docs

./gradlew doxygen

Project layout

  • src/ : main and test sources
  • thrifty-lib/ : vendored/shared library code used by the project
  • build/ : Gradle build outputs (executables, libs, reports)
  • install/ : installable artifacts
  • Valkyrie.json : project metadata used by tooling

Architecture

The codebase follows a clear, modular robot architecture built around small, testable components:

  • BaseSubsystem: an abstract subsystem pattern that every robot subsystem implements. Subsystems follow a 20ms cycle broken into assessInputs() (teleop-only), analyzeDashboard() (always-on), and assignOutputs() (enabled modes). This enforces consistent read/state/write ordering across the robot.
  • Loggable: a lightweight NetworkTables wrapper used by subsystems and components to publish and subscribe telemetry in a type-safe way.
  • Input layer: Gamepad wraps WPILib controllers with deadbands, filters, and helper methods to provide clean operator inputs.
  • Drive layer: drivetrain/ implements a Swerve drivetrain with Swerve and SwerveModule implementations (motion/control lives here).
  • Sensors: the sensors/ folder contains device-specific wrappers (Lidar, Vision/AprilTags, CAN-based sensors, proximity, current, etc.) that expose normalized sensor state for subsystems to consume.
  • Controllers & utilities: controllers/ (e.g. NeoController) and util/ provide control algorithms, profiling (Profiler), signal management (PhoenixSignalManager), and coordinate transforms (RobotToWorldConverter / WorldAlign).
  • Autonomous: Auto manages selectable autonomous commands and integrates external command sources when needed.

This separation keeps hardware I/O and device specifics inside sensor/drive classes, state and decision logic in subsystems, and command composition in the Auto and command scheduler. It makes unit testing and simulation easier (see src/test) and keeps dashboard/logging concerns centralized via Loggable and the NetworkTables integrations.

Running tests

  • Unit tests are executable native tests. Use ./gradlew test which runs Google Test suites and writes results to build/test-results and TEST-UNIT.xml.

Notes for contributors

  • Code style/formatting is managed with the included Gradle/WPILib formatter. Run ./gradlew format before committing.
  • This project uses the Gradle wrapper (gradlew) — run all Gradle tasks through the wrapper for reproducible builds.

License

  • See the LICENSE file at the repository root.

More

  • For CI, vendordeps, and packaging details check publish.gradle, config.gradle and gradle.properties.