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
- Computes and stores (JSON) a 2D cubic spline curve, essentially solving for the coefficients of 2(n - 1) cubic polynomials, n = # of waypoints, using continuity and a large tridiagonal matrix
- Interpolates to switch the input from the meaningless parametric “T” to distance, more useful for the motion profile
- Resources used
Motion Profile
- Creates piecewise equations that output the optimal velocity and acceleration at a given distance, applying basic kinematic equations that relate velocity, acceleration and distance
- Each interval represents a segment along the profile’s spline, each the same length
- Resources used
Localization
- Views the field as an x, y coordinate plane
- Calculates the change of the robot’s position and heading every 10 milliseconds, according to 3 odometry sensors (int values), and adds its it to a manually set initial pose
- Resources used
PID
- Calculates an error correction vector (tuned custom Proportional-Integral-Derivative loop) for a robot to apply while following a path
- Resources used
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
- 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
- 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
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