Skip to content

Instantly share code, notes, and snippets.

#include "motion.h"
#include <cmath>
#include <iostream>
using namespace std;
/**
* @param distance in encoder ticks
* @param max_v in ticks/100ms
@jhh
jhh / TalonTestRobot.java
Last active February 19, 2018 15:46
Example program and output for TalonSRX current limit issue
package org.team2767.thirdcoast;
import com.ctre.phoenix.ErrorCode;
import com.ctre.phoenix.motorcontrol.ControlMode;
import com.ctre.phoenix.motorcontrol.can.TalonSRX;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Timer;
public class TalonTestRobot extends IterativeRobot {
@jhh
jhh / tct
Last active November 19, 2017 16:20
TCT utility start script
#!/bin/sh
echo tct starting, please wait...
/usr/local/frc/JRE/bin/java -Djava.library.path=/usr/local/frc/lib/ -jar tct.jar 2> /dev/null
@jhh
jhh / create_lv.sh
Last active May 14, 2017 14:09
KVM Install Notes
lvcreate -n dns01 -V 10G --thinpool vg01/pool00
@jhh
jhh / roborio_deploy.sh
Last active December 11, 2016 23:17
Deploy C++ robot app to roboRIO
#!/bin/bash
# Put this in ~/.ssh/config to avoid the password check and ssh noise
# you need to have ssh public key for IdentityFile in roboRIO /home/admin/.ssh/authorized_keys
#
# Host roborio
# IdentityFile ~/.ssh/roborio
# HostName roborio-TTTT-frc.local
# User admin
# StrictHostKeyChecking no
@jhh
jhh / ex_002.py
Created August 3, 2016 15:33
Solution to exercise 2.
import cv2
import sys
import os
def simple_threshold(path, thresh):
# read in the image
img = cv2.imread(path)
# display the image and wait for key press
import cv2
import sys
import os
def simple_threshold(path, thresh):
# read in the image
img = cv2.imread(path)
# display the image and wait for key press
@jhh
jhh / ex_001.py
Last active September 1, 2016 01:31
Solution to exercise 1.
import cv2
import sys
import os
# usage: python ex_001.py path/to/image.jpg
imgPath = sys.argv[1]
if not os.path.isfile(imgPath):
print("Image file not found.")
sys.exit()
@jhh
jhh / keybase.md
Created September 20, 2014 11:13

Keybase proof

I hereby claim:

  • I am jhh on github.
  • I am jeffhutchison (https://keybase.io/jeffhutchison) on keybase.
  • I have a public key whose fingerprint is 158F 85E0 95D0 4DB2 6F7C 2BAF 9723 5478 A5CD 1073

To claim this, I am signing this object: