This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Motor at /Robot/robot/claw/conveyorMotor: | |
VoltHours: 1.038782 | |
AmpHours: 3.370920 | |
WattHours: 22.029070 | |
Motor at /Robot/robot/claw/clawMotor: | |
VoltHours: 0.785695 | |
AmpHours: 0.789711 | |
WattHours: 3.737691 | |
Motor at /Robot/robot/Arm/armMotor: | |
VoltHours: 0.041092 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The eventual goal here is to have a gradle task to automatically calcualte power draw for every | |
motor after every match. The sequence will look like this: | |
- After a match, the robot comes back into pit | |
- The pit programmer runs `./gradlew fetch-and-analyze-log` | |
- That task downlaods the latest match log | |
- That task scans through the match log and, for every motor, calculates the power draw in watt-hours, amp-hours, and volt-hours | |
Example output might look like this: | |
``` | |
Motor draw from match E12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
import sys | |
import pathlib | |
import shutil | |
import tempfile | |
import urllib.request | |
import concurrent.futures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person( object ): | |
def __init__( self, name, parent ): | |
self.name = name | |
self.children = [] | |
self.parent = parent | |
if parent: | |
parent.children.append( self ) | |
banana = Person( "Banana" ) | |
cherry = Person( "Cherry", parent=banana ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
do_something() | |
except IndexError: | |
raise SomeOtherException() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ObservableDualActionJoystick::TaskPrePeriodic(RobotMode mode) { | |
uint32_t currBtn = GetAllButtons(); | |
if (m_observer != nullptr) { | |
int mask = 1, buttonId = 0; | |
for ( int buttonId = 0; buttonId < 64; buttonId++ ) { | |
if (m_prevBtn & mask != currBtn & mask) { | |
m_observer->ObserveDualActionJoystickStateChange(m_port, buttonId, currBtn & mask); | |
} | |
mask <<= 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mpl_toolkits.mplot3d import axes3d | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
import numpy as npfig = plt.figure() | |
ax = fig.add_subplot(111, projection='3d')anchors | |
a = [0,57.735,30] | |
b = [50,-28.868,30] | |
c = [-50,-28.868,30]O = [0,0,0]X = np.arange(c[0],b[0],1) | |
Y = np.arange(b[1],a[1],1)def calc_T(a,b,c,o): | |
A = np.array([[(a[0]-o[0])/m.sqrt((a[0]-o[0])**2+(a[1]-o[1])**2+(a[2]-o[2])**2),(b[0]-o[0])/m.sqrt((b[0]-o[0])**2+(b[1]-o[1])**2+(b[2]-o[2])**2),(c[0]-o[0])/m.sqrt((c[0]-o[0])**2+(c[1]-o[1])**2+(c[2]-o[2])**2)], [(a[1]-o[1])/m.sqrt((a[0]-o[0])**2+(a[1]-o[1])**2+(a[2]-o[2])**2),(b[1]-o[1])/m.sqrt((b[0]-o[0])**2+(b[1]-o[1])**2+(b[2]-o[2])**2),(c[1]-o[1])/m.sqrt((c[0]-o[0])**2+(c[1]-o[1])**2+(c[2]-o[2])**2)], [(a[2]-o[2])/m.sqrt((a[0]-o[0])**2+(a[1]-o[1])**2+(a[2]-o[2])**2),(b[2]-o[2])/m.sqrt((b[0]-o[0])**2+(b[1]-o[1])**2+(b[2]-o[2])**2),(c[2]-o[2])/m.sqrt((c[0]-o[0])**2+(c[1]-o[1])**2+(c[2]-o[2])**2)]]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
""" | |
Simple pomodoro tracker that has been heavily customized to my personal needs. | |
Each pomodoro will wait for user input before continuing on meaning that | |
working a little long into your break does not reduce the duration of your | |
break (the break timer doesn't start until you press enter). When it is time | |
to move on, pomodoro will present a notification repeatedly using libnotify. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
class Item(): | |
def __init__(self, x, y, z, width, height, depth): | |
self.x = x | |
self.y = y | |
self.z = z | |
self.width = width | |
self.height = height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import enchant | |
d = enchant.Dict("en_US") | |
num_mappings = { | |
1: [], | |
2: ['a', 'b', 'c'], | |
3: ['d', 'e', 'f'], | |
4: ['g', 'h', 'i'], | |
5: ['j', 'k', 'l'], |
NewerOlder