Skip to content

Yet-Another-Software-Suite/yamg

Repository files navigation

FRC Mechanism Code Generator

A web-based tool for generating Java code for FRC (FIRST Robotics Competition) mechanisms like elevators, arms, and pivots.

Overview

This tool helps FRC teams quickly generate well-structured, command-based Java code for common robot mechanisms. It provides:

  • Form-based configuration for mechanism parameters
  • Real-time simulation of mechanism behavior
  • Generated Java code for subsystems with proper control methods
  • Support for different motor controllers (SparkMAX, SparkFlex, TalonFX, TalonFXS, ThriftyNova, Redux Nitro)
  • Support for different motor types (NEO, NEO550, Minion, Krakenx44, Krakenx60, Cu60, Cu40)

Features

  • Code Generation: Create Java subsystem classes with proper control methods, telemetry, and simulation support
  • Interactive Simulation: Test and visualize mechanism behavior with adjustable parameters
  • Multiple Mechanism Types: Support for elevators, arms, and pivots (turrets/wrists)
  • Comprehensive Configuration: Configure PID values, feedforward constants, soft limits, current limits, and more
  • Static Export: The site can be built as a static site for easy deployment

Getting Started

Prerequisites

  • Node.js 18.x or higher
  • pnpm (recommended) or npm/yarn

Installation

  1. Clone the repository:

    gh repo clone Yet-Another-Software-Suite/yamg
    cd yamg
  2. Install dependencies:

    pnpm install
  3. Start the development server:

    pnpm dev
  4. Open http://localhost:3000 in your browser.

Deployment to GitHub Pages

This project is configured for easy deployment to GitHub Pages:

  1. Update the basePath in next.config.mjs to match your repository name:

    basePath: '/your-repo-name',
  2. Build and export the static site:

    pnpm build
  3. Push the out directory to the gh-pages branch:

    git add out/ -f
    git commit -m "Deploy to GitHub Pages"
    git subtree push --prefix out origin gh-pages

    Alternatively, you can use a GitHub Action to automate deployment (see .github/workflows/deploy.yml).

Project Structure

  • /app: Next.js app router pages
  • /components: React components for the UI
  • /lib: Core logic for code generation and simulation
    • /lib/motor-controllers: Motor controller specific code
    • /lib/simulation: Simulation classes
  • /public: Static assets and template files
    • /public/templates: Handlebars templates for code generation
    • /public/simulation: JavaScript simulation files

Documentation

For more detailed information, see the documentation in the /docs directory:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Yet Another Mechanism Generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7