Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Hyperion-9614/UltimateGoal

Repository files navigation

Build Status

Build Status

Current Features

OpenCV Pipelines

  • Written in C++ and processes each frame in 2 ms
    • Allows the algorithm to run at ~500 fps (Capped at 30 due to hardware limitations)
  • Uses custom resolution upscaling algorithm to upscale the resolution to 1080p from 480/720p camera resolution
  • Applies multiple filters
    • HSV filter to eliminate red tones
    • YCrCb filter to filter out everything but the rings
    • Custom color filtering tuning algorithm
      • Uses K-Means Clustering to find the dominant color in a Region of Interest and tunes filters
  • Applies custom contouring algorithm to find the outline of all rings
  • Checks the aspect ratio of the rings to find out how many rings are present in the stack
  • Now also uses distance mapping to track rings and render in dashboard
  • Images can be found below

Spline Trajectory Calculator

Motion Profile

Localization

PID

Constants

  • Allows values in a multi-level constants.json to be read from and written to using a flat, dot-separated ID string

Dashboard

  • Modern, colorful GUI that allows a user to easily edit splines and waypoints, edit constants, view robot telemetry, and view and simulate paths

Simulator

  • Feature of the Dashboard
  • Visualizes how the robot would follow a spline according to its motion profile, randomly-introduced error, and PID correction

Socket Communication System

  • Event-based communication between two sockets (robot controller phone and laptop running the Dashboard)
  • Allows a user to see a real-time representation of where the robot thinks it is on the field, according to the localization algorithm

Setup

  • Go to File -> Project Structure
    • Select a version of jdk 8
  • Create a new run configuration (Application)
    • Give the configuration the name "Dashboard"
    • Select the Dashboard class in HyperiLibs as the main class
    • Select the UltimateGoal.HyperiLibs module

How to run (debugging/non-competition)

  • Ensure that the "dashboard.isDebugging" flag in constants.json is true
  • Run the Dashboard application
  • Using the Android Device File Explorer tab, move constants.json and field.json to the RC's data/data/com.qualcomm.ftcrobotcontroller/files/hyperilibs folder
    • If this is the first time, you'll have to make a hyperilibs folder manually in data/data/com.qualcomm.ftcrobotcontroller/files
  • Build and run this application on the RC, then select and run an opmode

Libraries Used

Apache Commons Math3: org.apache.commons:commons-math3:3.6.1

  • Provides advanced math functions, such as matrices and integration

Mariuszgromada’s mXparser: org.mariuszgromada.math:MathParser.org-mXparser:4.4.2

  • Provides an easy way to parse and manipulate equations using Strings

org.json: org.json:json:20201115

  • JSON parsing and manipulation

underscore: com.github.javadev:underscore:1.60

  • Utility library - makes modern programming features available in Java

RevExtensions: org.openftc:rev-extensions-2:1.2

  • Allows a programmer to more thoroughly access the capabilities of the FTC REV Expansion Hub, such as LED colors and bulk data reading

CommonsIO: commons-io:commons-io:2.8.0

  • Improves input/output functionality