Skip to content

Instantly share code, notes, and snippets.

View ArchdukeTim's full-sized avatar
🏠
Working from home

Tim Winters ArchdukeTim

🏠
Working from home
View GitHub Profile
@ArchdukeTim
ArchdukeTim / App.java
Created March 10, 2020 17:12
CS3733 Starter Code
package edu.wpi.teamname;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class App extends Application {
@ArchdukeTim
ArchdukeTim / old_data.c
Created January 29, 2020 22:53
old data
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
void foo() {
volatile int i = 0;
volatile char x[] = "exploit";
printf("Doing something with %s\n", x);
}
@ArchdukeTim
ArchdukeTim / Over
Created February 17, 2019 18:23
Overridable autonomous
class OverridableAutonomous(AutonomousStateMachine)
joystick: wpilib.Joystick
def on_iteration(self):
if self.joystick.getRawButton()
# change to teleop
class Autonomous(OverridableAutonomous):
@timed_state
...
import cv2
import csv
################
################
# For this part, I recommend cropping the image so you can really see things.
# Whatever you crop it to, save those coordinates
THREED_STARTX = 1420
THREED_ENDX = 2030
//The Structures for Lines, Sets and the cache itself///
struct Line {
int valid;
unsigned long tag;
int age;
};
struct Set {
struct Line* lines;
};
//
// FrameExtractor.swift
// Created by Bobo on 29/12/2016.
//
import UIKit
import AVFoundation
protocol FrameExtractorDelegate: class {
func captured(image: UIImage)
while (change >= tolerance)
{
change = 0.0;
for (int i = 1; i < path.length - 1; i++)
{
for (int j = 0; j < path[i].length; j++)
{
double aux = newPath[i][j];
newPath[i][j] += (weight_data * (path[i][j] - newPath[i][j])) + (weight_smooth * (newPath[i - 1][j] + newPath[i + 1][j] - (2.0 * newPath[i][j])));
change += Math.abs(aux - newPath[i][j]);
package com.qualcomm.ftcrobotcontroller.opmodes.autonomous;
/**
* Created by winterst on 2/11/16.
*/
public class BlueColorAuto extends StatefulAutonomous{
@timed_state(duration = 15, first = true)
public void driveForward() throws NoSuchMethodException {
tank.move(-.25f, -.25f);
from pyfrc.physics.drivetrains import four_motor_drivetrain
import wpilib
class PhysicsEngine:
def __init__(self, controller):
self.controller = controller
def update_sim(self, hal_data, now, tm_diff):
@ArchdukeTim
ArchdukeTim / Field
Last active February 20, 2016 04:31
"field": {
"w": 27,
"h": 27,
"px_per_ft": 10,
"objects": [
{ "color": "blue",
"points": [ [0, 0], [0, 4.5], [24, 4.5], [24, 0] ] },