Autonomy Software Binder

Central engineering reference and operations manual for the MRDT Autonomy Software.

View the Project on GitHub MissouriMRDT/Autonomy_Software

Return to RoveSoDocs Guides for Today, Tomorrow, and Forever.

Contributing & Documentation Integration Guide

This guide details the end-to-end workflow for contributing to the Autonomy Software Binder, as well as the Generalized MRDT Docs Hub Playbook used to integrate any Missouri S&T Mars Rover Design Team repository into the centralized documentation portal at docs.themrdt.org.


1. Documentation Philosophy & Architecture

MRDT Software employs a Dual-Docset Architecture to serve different engineering needs without cluttering codebases or confusing users:

Documentation Type Engine Route Subpath Primary Audience & Purpose
API Reference (Doxygen) Doxygen + Graphviz /<repo>/_d/ Developers requiring low-level C++ class declarations, function signatures, inheritance graphs, and inline source comments.
Engineering Manual (Binder) Jekyll / GitHub Pages / Pandoc /<repo>/_j/ System architects, field operators, and new members requiring high-level subsystem deep dives, state machine workflows, tuning guides, and deployment checklists.
Documentation Hub VitePress / Central landing portal, global search index, and directory of all MRDT software projects.

2. Contributing to the Autonomy Binder

A. Repository & Branch Strategy

To ensure that heavy build artifacts (compiled PDFs, LaTeX packages, pandoc build scripts, and Jekyll web templates) do not bloat the core C++ codebase, documentation is maintained on an isolated branch:

Workflow for Documentation Updates:

  1. Check out the documentation branch:
    git checkout docs/autonomy-binder
    
  2. When new features or major refactors land in development, sync the branch:
    git merge development
    
  3. Make your documentation additions or edits inside docs/autonomy_binder/.
  4. Commit your changes and open a pull request targeting docs/autonomy-binder.

B. Directory Structure & File Naming Conventions

All binder documentation lives in docs/autonomy_binder/. Chapters use a two-digit numeric prefix (00_ to 16_) to guarantee deterministic ordering across both the web navigation and the compiled Pandoc PDF:

docs/autonomy_binder/
|-- 00_Table_of_Contents.md                      # Master TOC parsed by Pandoc compile script
|-- 01_Quick_Start_and_Ops.md                    # Environment setup, build instructions, hotkeys
|-- 02_Architecture_Overview.md                  # High-level architecture & pipeline diagrams
|-- 03_The_State_Machine.md                      # Autonomy State Machine specification
|-- 04_Subsystems_Deep_Dive/                     # Subsystem engineering specifications
|   |-- Control_and_Actuation.md
|   |-- Path_Planning.md
|   \-- Perception.md
|-- 05_Configuration_and_Tuning/                 # Autonomy constants and CMake build flags
|   |-- Autonomy_Constants.md
|   \-- CMake_Options.md
|-- 06_Troubleshooting_Guide.md                  # Field diagnostics & fault recovery
|-- 07_Board_Drivers/                            # Drive, Nav, and Multimedia board drivers
|-- 08_Handlers/                                 # Subsystem handlers (Camera, LiDAR, Waypoints)
|-- 09_Threading/                                # Thread pools & AutonomyThread interface
|-- 10_Networking/                               # RoveComm UDP/TCP protocol specification
|-- 11_Logs_and_Data/                            # Quill logging, video recording, visualization
|-- 12_Vision/                                   # Cameras, ArUco detection, YOLO object detector
|-- 13_Controllers/                              # PID, Pure Pursuit, and Predictive Stanley
|-- 14_URC_Rules/                                # URC 2027 Autonomy Rules specification
|-- 15_Checklists/                               # Field checklists and release procedure
|-- 16_Contributing_and_Docs_Guide/              # This contribution & integration guide
|   \-- Contributing_and_Docs_Integration.md
|-- _includes/                                   # Jekyll layout components
|   |-- head-custom.html                         # MathJax 3 and responsive CSS grid styling
|   \-- navigation.html                          # Sidebar chapter navigation template
|-- _layouts/                                    # Jekyll base layouts
|   \-- default.html                             # Theme wrapper based on godalming123/minimal
|-- _config.yml                                  # Jekyll configuration & exclusions
|-- Gemfile                                      # Ruby gems (github-pages)
\-- index.md                                     # Web landing page for /autonomy/_j/

C. Formatting Standards

To ensure flawless rendering across both GitHub Pages (HTML) and Pandoc (pdflatex PDF generation):

  1. Heading Hierarchy:
    • Use a single # Level 1 Heading for the chapter title.
    • Use ## Level 2 Heading for primary sections.
    • Use ### Level 3 Heading for subsections.
  2. Lists:
    • Always place a blank empty line before any bulleted (-) or numbered (1.) list. Pandoc will clump lists together if a preceding blank line is missing.
  3. Internal Relative Hyperlinks:
    • Always use relative Markdown links with the .md extension:
      [Predictive Stanley Controller](/autonomy/_j/13_Controllers/Predictive_Stanley_Controller.html)
      
    • The jekyll-relative-links plugin in GitHub Pages automatically translates .md to .html in web builds, while Pandoc preserves the cross-document anchors.
  4. LaTeX Mathematical Formulations:
    • Equations are rendered via MathJax 3 on the web and native LaTeX in Pandoc.
    • Inline Equations: Wrap math in single dollar signs $ ... $ or \( ... \):
      Rover rotational effort is bounded by $u \in [-1.0, 1.0]$.
      
    • Display Equations: Wrap standalone block math in double dollar signs $$ ... $$ or \[ ... \]:
      $$\delta(t) = \theta_e(t) + \arctan\left(\frac{k \cdot e(t)}{v(t)}\right)$$
      
    • Shell Variable Escaping: Always enclose bash variables and shell commands like $(nproc) in backticks (`make -j$(nproc)`) so MathJax does not interpret them as math delimiters.

D. Local Testing & Compilation

1. Previewing Web Docs Locally (Jekyll)

Install Ruby (version 3.2+) and Bundler, then run inside docs/autonomy_binder/:

cd docs/autonomy_binder
bundle install --path vendor/bundle
bundle exec jekyll serve

Open http://localhost:4000/autonomy/_j/ in your browser.

2. Compiling the Autonomy Binder to a Single Markdown & PDF (Pandoc)

The Autonomy repository includes automated shell scripts that concatenate all chapters in the exact order declared in 00_Table_of_Contents.md:

# From repository root:
bash tools/compile_binder_pandoc.sh

[!NOTE] PDF generation requires pandoc and pdflatex (e.g., via TeX Live or MiKTeX). If running inside the official Autonomy Dev Container, all TeX packages and Pandoc binaries are pre-installed.


3. Generalized RoveSoDocs Integration Playbook

This playbook provides the exact 6-step blueprint for connecting any new or existing MRDT repository (e.g., RoveSoSimulator, Embedded_Docs, Science_Software, etc.) to the central documentation hub at docs.themrdt.org.

Architecture Overview

[Target Repo (docs branch)]
   +-- Jekyll or Doxygen files
   \-- Pushed to GitHub
             |
             v
[RoveSoDocs (.github/workflows/deploy.yml)]
   +-- 1. build_<repo>_jekyll (outputs to out/<repo>/_j)
   +-- 2. build_<repo>_doxygen (outputs to out/<repo>/_d)
   +-- 3. assemble (merges all out/ artifacts into dist/)
   +-- 4. build-minisearch-index.mjs (indexes dist/)
   \-- 5. deploy (publishes to GitHub Pages via Cloudflare)

Step 1: Prepare the Source Repository

  1. Create a Dedicated Docs Branch: Create a clean branch in your repository (e.g., docs/binder or github-pages).
  2. Add a Gemfile: In your documentation root (e.g., docs/binder/Gemfile):
    source "https://rubygems.org"
    gem "github-pages", group: :jekyll_plugins
    
  3. Configure _config.yml: Create _config.yml with the following essential configuration:
    title: Your Subsystem Name
    description: Engineering manual and operations reference.
    url: "https://docs.themrdt.org"
    baseurl: "/<repo>/_j"
    
    remote_theme: "godalming123/minimal"
    plugins:
      - jekyll-remote-theme
      - jekyll-optional-front-matter
    
    repository: "MissouriMRDT/<Your_Repo>"
    
    defaults:
      - scope:
          path: ""
        values:
          layout: "default"
    
    # CRITICAL: In Jekyll 3.x, specifying exclude overrides defaults!
    # You MUST explicitly exclude vendor/bundle to prevent gem ERB parsing crashes.
    exclude:
      - vendor
      - vendor/*
      - .bundle
      - .sass-cache
      - .jekyll-cache
      - gemfiles
      - Gemfile
      - Gemfile.lock
      - node_modules
      - "*.pdf"
      - "*_Pandoc.md"
    
  4. Create Layout Overrides:
    • _layouts/default.html: Wrap the layout with <header> (containing title, “Return to RoveSoDocs” link, and navigation) and <section> (containing `<h1 id="autonomy-software-release-procedure--changelog-guide">Autonomy Software Release Procedure & Changelog Guide</h1>

This guide defines the end-to-end standard operating procedure for preparing, auditing, drafting, and publishing official GitHub releases for the MRDT Autonomy Software repository (MissouriMRDT/Autonomy_Software).


1. Overview & Release Philosophy

In the Mars Rover Design Team, Autonomy Software releases mark major engineering milestones:

Versioning Convention

Releases follow semantic versioning adapted to the rover competition cycle: v<Year>.<Minor>.<Patch>


2. Prerequisites & Tooling

Before creating a release, ensure you have:

  1. GitHub CLI (gh):
    • Installed and authenticated with repository write access:
      gh auth status
      
    • Must show logged in with repo scope.
  2. Git Client:
    • Clean working copy on the default branch (development).
  3. Python 3 & jq:
    • Used for parsing PR JSON metadata and generating the Full Development Log.

3. Step-by-Step Release Workflow

Step 1: Branch Verification & Sync

All releases are cut from the default development branch. Do not cut releases from unmerged feature branches.

# 1. Switch to development branch
git checkout development

# 2. Fetch and pull latest remote changes
git fetch origin
git pull origin development

# 3. Verify working directory is clean
git status

Confirm the output reports: Your branch is up to date with 'origin/development' and nothing to commit, working tree clean.


Step 2: Determine Previous Release Tag

Locate the most recent published release tag to establish the diff baseline:

gh release list --limit 5

Alternatively, query git tags:

git tag -l -n1 --sort=-creatordate

Example output: v25.1.0 (published previously). All commits and PRs between v25.1.0 and HEAD will comprise the new release.


Step 3: Extract Merged Pull Requests

Use the GitHub CLI to pull structured JSON data for all merged pull requests since the last release tag:

gh pr list --state merged --base development --limit 100 --json number,title,author,mergedAt,url,labels,body

You can use the GitHub Releases API to automatically preview the changelog and discover first-time contributors:

gh api repos/MissouriMRDT/Autonomy_Software/releases/generate-notes \
  -f tag_name=<NEW_TAG> \
  -f previous_tag_name=<PREV_TAG> \
  -f target_commitish=development

Example:

gh api repos/MissouriMRDT/Autonomy_Software/releases/generate-notes \
  -f tag_name=v26.0.0 \
  -f previous_tag_name=v25.1.0 \
  -f target_commitish=development

Step 4: Audit Commit History & Identify New Contributors

Check git log to verify that no direct merge commits or branch contributions are omitted:

# View all commit titles since the previous tag
git log <PREV_TAG>..HEAD --oneline

# View all authors who contributed commits in this cycle
git log <PREV_TAG>..HEAD --format="%an <%ae>" | sort -u

Identify first-time contributors by checking authors who had never merged commits before <PREV_TAG>:

python3 -c "
import subprocess
def get_authors(rev):
    return set(subprocess.check_output(['git', 'log', rev, '--format=%aN <%aE>'], text=True).splitlines())
brand_new = get_authors('<PREV_TAG>..HEAD') - get_authors('<PREV_TAG>')
for a in sorted(brand_new):
    print('-', a)
"

Step 5: Draft the Release Notes (RELEASE_NOTES.md)

Create a local RELEASE_NOTES.md file in the workspace root. Structure the document according to the following mandatory sections:

Required Sections & Format

### **Autonomy Software <VERSION> – <TITLE>: <SUBTITLE>**

<Executive summary paragraph describing the release context, competition performance, testing score (e.g., 86/100 at URC), and core themes.>

> **Breaking Changes**: <High-level warning outlining major backward-incompatible changes, removed states, or new submodule/toolchain requirements.>

---

### Breaking Changes

#### <Subsystem 1 Name>
- <Bullet points detailing breaking API changes, removed classes, or new database formats.>

#### <Subsystem 2 Name>
- <Details on deprecated workflows, build flag adjustments, or configuration file removals.>

---

### Key Updates

#### <Subsystem Area: e.g., Terrain-Aware Path Planning (GeoPlanner & LiDARHandler)>
- <Technical details of implementation, algorithms (KD-trees, R-Trees), performance improvements.>

#### <Subsystem Area: e.g., Predictive Stanley Controller & Tank-Drive Kinematics>
- <Details on controller redesigns, physics models (UnicycleModel), and deceleration logic.>

#### <Subsystem Area: e.g., Multi-Class Object Detection>
- <Models trained, target classes (Mallet, Bottle, Rock Pick), and dataset collection.>

#### <Subsystem Area: e.g., Approaching & Verifying Marker/Object States>
- <State machine enhancements, bounding box verification image capture, and HTTP REST serving.>

#### <Subsystem Area: e.g., Autonomy Live 3D Visualizer Tool>
- <Interactive browser dashboard features, telemetry feeds, and spatial deduplication.>

#### <Subsystem Area: e.g., Search Patterns & Stuck-State Path Splicing>
- <Search trajectories (Snake, double-spiral), stuck recovery detour splicing, and path persistence.>

#### <Subsystem Area: e.g., Simulation Parity & WebRTC Streaming>
- <Simulation stability, WebRTC connection improvements, and asynchronous camera APIs.>

---

### Validated On

#### Hardware & Software Stack
- **Compute**: <e.g., NVIDIA Jetson AGX Orin Developer Kit>
- **Operating System**: <e.g., JetPack 6.2 (L4T 36.4.0)>
- **CUDA Toolchain**: <e.g., CUDA 12.6.3, TensorRT, LibTorch>
- **Perception Hardware**: <e.g., Dual Stereolabs ZED 2i Cameras (Front & Rear)>
- **Container Environment**: <e.g., Ubuntu 22.04 LTS (Jammy) Docker>

#### Field Validation & Testing Grounds
- **URC Competition**: <Mission scores, location, conditions (e.g., MDRS Hanksville, UT - 86/100)>
- **Field Testing**: <Trials in Tucumcari, Rolla, or other testing sites>
- **Simulation**: <Validation in RoveSoSimulator (e.g., 100/100 score on path splicing)>

---

### What’s Next
- <Bullet point 1: Next milestone feature>
- <Bullet point 2: Multi-camera fusion / sensor upgrade>
- <Bullet point 3: Autonomous state expansions>

---

**Huge congratulations and thanks to the entire Autonomy subteam and MRDT members who worked tirelessly to bring this software to competition!**

---

### Full Development Log
* <PR 1 Title> by @<Author> in https://github.com/MissouriMRDT/Autonomy_Software/pull/<PR_NUMBER>
* <PR 2 Title> by @<Author> in https://github.com/MissouriMRDT/Autonomy_Software/pull/<PR_NUMBER>
...

## New Contributors
* @<Contributor1> made their first contribution in https://github.com/MissouriMRDT/Autonomy_Software/pull/<PR_NUMBER>
* @<Contributor2> made their first contribution in https://github.com/MissouriMRDT/Autonomy_Software/pull/<PR_NUMBER>

Special thanks to all team members contributing commits, models, datasets, and testing hours to this release cycle: <List of all active contributors>.

**Full Changelog**: https://github.com/MissouriMRDT/Autonomy_Software/compare/<PREV_TAG>...<NEW_TAG>

Step 6: Create Draft Release on GitHub

Always create the release as a Draft first. This permits the team and leads to verify the formatting, links, and text directly on GitHub without triggering webhook deployments or alerting subscribers prematurely.

Run the gh release create command:

gh release create <NEW_TAG> \
  --title "Autonomy Software <NEW_TAG> - <TITLE>" \
  --notes-file RELEASE_NOTES.md \
  --target development \
  --draft

Example:

gh release create v26.0.0 \
  --title "URC 2026 - Competition Release" \
  --notes-file RELEASE_NOTES.md \
  --target development \
  --draft

The command will output the draft URL: https://github.com/MissouriMRDT/Autonomy_Software/releases/tag/untagged-...


Step 7: Review and Publish

  1. Verify Draft in Web Browser: Open the draft release link returned by gh. Ensure that:
    • All PR links navigate to the correct PRs.
    • Code blocks and backticks render cleanly.
    • There are zero stray characters or emojis.
    • The target branch is set to development.
  2. Publish the Release:
    • Option A (Web UI): Click the Publish release button on the GitHub release edit page.
    • Option B (GitHub CLI):
      gh release edit <DRAFT_ID_OR_TAG> --draft=false --tag <NEW_TAG>
      
  3. Synchronize Local Tags: After publishing, pull down the new git tag to your local environment:
    git fetch --tags origin
    

4. Common Pitfalls & Best Practices

Pitfall Impact Prevention
Direct shell script backtick evaluation Backticks in release notes get interpreted by bash as command substitutions (e.g., `UnicycleModel` tries to run command UnicycleModel). When using bash scripts or python to generate markdown files, use quoted heredocs (cat <<'EOF') or read directly from files.
Omitting submodule updates Submodules like data/LiDAR or submodules/RoveComm_CPP may be on different commits than what the release expects. Document submodule init commands (git submodule update --init --recursive) under Breaking Changes.
Cutting from feature branches Release tags will not point to master/development HEAD, causing merge conflicts or dangling commits. Always ensure git status confirms you are on development up to date with origin/development.
Publishing before review Missing PRs or formatting bugs cannot be cleanly retracted once tags are pushed to remote clones. Always use --draft flag on gh release create and preview before publishing.
Emojis in release notes Clutters terminal release feeds and breaks automated changelog parsers. Keep release text strictly alphanumeric and standard markdown typography.

`).


Step 2: Add Build Job to RoveSoDocs Workflow

In MissouriMRDT/RoveSoDocs, open .github/workflows/deploy.yml and add a new build job:

  # -------------------------
  # Build <Repo> (Jekyll)
  # -------------------------
  build_<repo>_jekyll:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout <Repo> (Jekyll)
        uses: actions/checkout@v4
        with:
          repository: MissouriMRDT/<Your_Repo>
          ref: docs/binder
          path: src/<Your_Repo>
          fetch-depth: 1
          submodules: false
          token: $

      - name: Setup Ruby (for Jekyll) - no cache
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.2.4"
          bundler-cache: false
          working-directory: src/<Your_Repo>/docs/binder

      - name: Install gems (fresh, no cache)
        working-directory: src/<Your_Repo>/docs/binder
        env:
          BUNDLE_WITHOUT: "development:test"
        run: |
          set -euo pipefail
          rm -rf .bundle vendor/bundle Gemfile.lock
          gem --version
          bundler --version || gem install bundler
          bundle config set --local path 'vendor/bundle'
          bundle config set --local clean 'true'
          bundle config set --local without 'development:test'
          bundle install --jobs 4 --retry 3

      - name: Build site into out/
        working-directory: src/<Your_Repo>/docs/binder
        env:
          JEKYLL_ENV: production
          PAGES_REPO_NWO: MissouriMRDT/<Your_Repo>
          JEKYLL_GITHUB_TOKEN: $
        run: |
          set -euo pipefail
          mkdir -p "$GITHUB_WORKSPACE/out/<repo>/_j"
          bundle exec jekyll build \
            --trace \
            --baseurl "/<repo>/_j" \
            -d "$GITHUB_WORKSPACE/out/<repo>/_j"

      - name: Upload jekyll artifact
        uses: actions/upload-artifact@v4
        with:
          name: <repo>-jekyll-out
          path: out

Step 3: Merge Artifacts in the assemble Job

In deploy.yml, update the assemble job:

  1. Add to needs:
    assemble:
      runs-on: ubuntu-latest
      needs:
        - build_hub
        - build_<repo>_jekyll
        # ... other build jobs
    
  2. Merge into dist/:
        - name: Merge artifacts into dist/
          run: |
            set -euo pipefail
            mkdir -p dist
            rsync -a "parts/hub-out/" dist/
            rsync -a "parts/<repo>-jekyll-out/" dist/
            # ... other artifacts
            touch dist/.nojekyll
    

Step 4: Configure SPA Routing & 404 Refresh

VitePress is a Single Page Application (SPA). To prevent client-side routing from hijacking requests to sub-sites and returning a 404:

In RoveSoDocs/.vitepress/theme/NotFoundContent.vue:

  1. Add the path prefix to REFRESH_PREFIXES:
    const REFRESH_PREFIXES = [
      '/autonomy/_d/',
      '/autonomy/_j/',
      '/<repo>/_j/',
      '/<repo>/_d/',
      // ...
    ];
    
  2. Add quicklinks to quickLinks:
    { text: '<Repo> Docs (Binder)', href: '/<repo>/_j/' },
    

Step 5: Update the Unified Search Index

In RoveSoDocs/tools/build-minisearch-index.mjs:

Update sectionFromUrl(url) with regular expressions for your docset:

function sectionFromUrl(url) {
  if (url.startsWith('/<repo>/_j/')) return '<Repo> Documentation (Binder)';
  if (url.startsWith('/<repo>/_d/')) return '<Repo> Documentation (Doxygen)';
  // ...
}

This ensures search results in the top navbar (Ctrl+K) categorize entries under clean, human-readable subsystem headers.


Step 6: Add Homepage Feature Cards

In RoveSoDocs/index.md:

Add a feature card under features::

  - icon: ":book:" # Or emoji like book, robot, battery in VitePress
    title: "<Repo> Documentation (Binder)"
    details: "High-level subsystem engineering manual, architecture guide, and operational instructions."
    link: /<repo>/_j/
    linkText: "Open <Repo> Docs"

[!TIP] Maintain clean grid balance on the homepage. MRDT’s homepage layout is optimized for a 3-column grid on desktop screens (@media (min-width: 1400px)). Aim for multiple-of-3 card counts (6, 9, or 12 cards) for a visually symmetrical presentation.


4. Common Pitfalls & Troubleshooting Checklist

Issue / Symptom Root Cause Resolution
Invalid date '<%= Time.now...' in welcome-to-jekyll.markdown.erb Jekyll 3.x exclude: list completely overrides default exclusions. When vendor/bundle was created by bundler, Jekyll tried to compile gem templates. Add vendor, vendor/*, and .bundle explicitly to exclude: in _config.yml.
Narrow 500px Content Column on Desktop The default minimal theme hardcodes section { width: 500px; float: right; }. Implement the responsive CSS Grid override in _includes/head-custom.html.
Raw LaTeX ($...$) Rendering as Plain Text Jekyll Markdown engine does not convert math unless a client-side renderer is loaded. Load MathJax 3 tex-svg.js in _includes/head-custom.html.
Missing Bullet Lists in Compiled Pandoc PDF Pandoc requires a blank line preceding any bullet or numbered list. Ensure an empty line separates all paragraphs from bullet points.
Old 5-Card Layout Showing After Deploy VitePress client-side PWA caching. Perform a hard refresh in the browser (Ctrl + F5 or Cmd + Shift + R).