Skip to content

Instantly share code, notes, and snippets.

package frc.robot.util;
import com.revrobotics.CANSparkMax;
import com.revrobotics.REVLibError;
import java.util.function.Function;
public class SparkConfigurator {
private CANSparkMax spark;
private int uniqueConfigs = 0, totalCalls = 0;
package frc.robot;
import java.util.ArrayList;
import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.wpilibj.TimedRobot;
public class Robot extends TimedRobot {
PIDController controller = new PIDController(0, 0, 0);
import Measurement from "common/models/Measurement";
import Motor from "common/models/Motor";
import { MotorRules } from "common/models/Rules";
const torque = new MotorRules(Motor.Falcon500s(1), new Measurement(60, "A"), {
rpm: new Measurement(0, "rpm"),
voltage: new Measurement(12, "V"),
}).solve().torque;
// torque is 1.198 Newtonmeters
@tervay
tervay / main.py
Last active July 9, 2021 22:12
Flickr Video Downloader
from flickrapi import FlickrAPI
from lxml import etree
import requests
import shutil
import requests_cache
requests_cache.install_cache("flickr_cache")
key = "<key>"
SELECT
tname,
awardCount,
eventCount,
awardCount / eventCount AS awardsPerEvent
FROM (
SELECT
ATM.name AS tname,
COUNT(A.name_str) AS awardCount
FROM ( `tbatv-prod-hrd.the_blue_alliance.award` AS A

[[toc]]

How does TBA serve data?

TheBlueAlliance stores their data in a database, such as Google Cloud Datastore. However, databases themselves are typically heavily secured, so that bad actors can't intentionally edit the database and corrupt the data (and break the site). So instead, TBA exposes special URLs that return raw data, just like how specific URLs return a webpage. The data format that data is returned in is called JSON - a widely standardized format that many programming languages can understand.

Material Model Density (gm/cm^3) Young's Modulus (MPa) Tensile Strength (MPa) Bending Strength (MPa) Charpy impact strength (kJ/m^2)
Onyx [1] [2] [3] Markforged Onyx 1.2 1400 30 81 10.72
PLA [12] Prusa PLA 1.24 2200 50.8 12.7
PLA [4] PolyLite PLA 1.20 2636 46.6 85.1 2.7
PLA+ [5] PolyMax PLA 1.20 1879

Material comparison

Material Static Material Strength (MPa) Hook XY (kg) Hook Z (kg) Bending Modulus (MPa) Impact Strength (kJ/m^2) Notes
PLA 60 72 44 3000 5
PLA+ 48 34 2200 18 Deforms/stretches more than PLA
PETG 58 55 25 1900 8.6
ASA 47 57 17 2300 18

This doc was written on Windows 10 Version 2004 (OS Build 19041.388) using WSL 2 running Ubuntu 20.04.

Powershell:

PS C:\Users\justi> wsl --list --verbose
  NAME                   STATE           VERSION
* Ubuntu-20.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffcdf689442, pid=2480, tid=11544
#
# JRE version: Java(TM) SE Runtime Environment (11.0.2+9) (build 11.0.2+9-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.2+9-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [SparkMaxDriver.dll+0x9442]
#