Skip to content

Instantly share code, notes, and snippets.

@tervay
tervay / guide.md
Created February 9, 2016 20:40
Hello!
@tervay
tervay / divs.py
Last active April 30, 2016 03:22
naively simulate alliance selection at 2016 frc championships based purely on OPR
import requests
from pprint import pprint
class Team:
def __init__(self, key, opr, seed, dpr):
self.key = key
self.opr = opr
self.seed = seed
self.dpr = dpr
@tervay
tervay / file.py
Created May 28, 2016 23:09
An example of using the python requests library, using python 3.5
import requests
__api_key = {'X-TBA-App-Id': 'ex:ex:1'}
__tba_url = 'https://www.thebluealliance.com/api/v2/'
# team_number is type int
def make_team(team_number):
url = __tba_url + 'team/frc{0}'.format(team_number)
req = requests.get(url, headers=__api_key)
response = req.json()
Rank Team Elo (initial 25)
1 Citrus Circuits (1678) 51.954846457488564
2 Roboteers (2481) 50.067721182956674
3 CyberKnights (195) 47.18804123858085
4 The HOT Team (67) 46.7179141948823
5 OP Robotics (2056) 46.261077133829
6 The Cheesy Poofs (254) 46.11558903782744
7 Robowranglers (148) 46.099856171175496
8 The Beach Bots (330) 45.98478007390097
9 Mechanical Mayhem (1519) 45.597719704963005
Rank Team Elo (initial 1500)
1 Citrus Circuits (1678) 3117.290787449314
2 Roboteers (2481) 3004.0632709774004
3 CyberKnights (195) 2831.2824743148512
4 The HOT Team (67) 2803.074851692938
5 OP Robotics (2056) 2775.66462802974
6 The Cheesy Poofs (254) 2766.9353422696463
7 Robowranglers (148) 2765.99137027053
8 The Beach Bots (330) 2759.086804434058
9 Mechanical Mayhem (1519) 2735.8631822977804
Most 2-way alliance match wins:
[((<Team: HIGHROLLERS (987)>, <Team: TorBots (1197)>), 15),
((<Team: TechnoKats Robotics Team (45)>, <Team: Kil-A-Bytes (1024)>), 15),
((<Team: The Pascack PI-oneers (1676)>, <Team: Tiger Tech (5624)>), 14),
((<Team: The Cheesy Poofs (254)>, <Team: Citrus Circuits (1678)>), 14),
((<Team: TechnoKats Robotics Team (45)>,
<Team: Harrison Boiler Robotics (1747)>),
14),
((<Team: CyberKnights (195)>, <Team: Operation PEACCE Robotics (3461)>), 14),
((<Team: Walton Robotics (2974)>, <Team: East Cobb Robotics (4910)>), 13),
1 Citrus Circuits (1678) 3123.2248673515705 2.8273150375649494
2 Roboteers (2481) 3056.678232252578 2.565400328463039
3 CyberKnights (195) 2825.9963087336555 2.2141058768959443
4 The HOT Team (67) 2804.596975708663 2.2977102327934773
5 The Beach Bots (330) 2800.0648379770732 2.4735356015937398
6 OP Robotics (2056) 2787.5089661610677 2.2214336897959996
7 The Cheesy Poofs (254) 2767.97980277273 3.124782539296381
8 Robowranglers (148) 2754.2981586853475 2.5951191009193817
9 Mechanical Mayhem (1519) 2739.530594237671 2.549831988656131
10 THEORY6 (1241) 2734.6064474668815 2.508825212159747
Team Rating Winrate
Roboteers (2481) 3070.67 0.87
CyberKnights (195) 2835.94 0.84
The HOT Team (67) 2796.18 0.86
OP Robotics (2056) 2792.88 0.81
The Beach Bots (330) 2777.27 0.82
Robonauts (118) 2724.48 0.83
THEORY6 (1241) 2724.42 0.82
B.E.R.T. (133) 2707.36 0.84
TechFire (225) 2652.44 0.82
public class DriveTrain {
public void processAction(Action action) {
if (action.spec.equals("forwards")) {
driveForwards(action.magnitude);
}
}
public void driveForwards(int magnitude) {
// ...
}
public interface Subsystem {
/**
* Called once when the robot enters the disabled state.
*/
void initDisabled();
/**
* Called once when the robot enters the teleop state.
*/
void initTeleop();