Skip to content

Instantly share code, notes, and snippets.

View sumsted's full-sized avatar

Scott Umsted sumsted

  • Collierville, TN
View GitHub Profile
import signal
import socket
import time
class TeleopController():
UDP_ADDRESS = '192.168.1.58'
UDP_PORT = 8484
MESSAGE = "%04d%04d%04d"
import json
import redis
class RoverShare:
host = '192.168.3.9'
port = 6379
command_queue_key = 'vision_command_queue'
location_key = 'location'
@sumsted
sumsted / angle_radians.py
Created January 8, 2018 05:23
flip the ar to get the drive pointed in the correct direction the quickest way
ar = 3.2
la = 4.3
if abs(ar - la) > math.pi/2:
reverse = True
ar += math.pi if ar < math.pi else -math.pi
@sumsted
sumsted / radian_delta.py
Created January 8, 2018 05:19
difference between two radians
def radian_delta(r1, r2):
d = abs(r1 - r2)
if d < math.pi:
d *= 1 if r1 > r2 else -1
else:
d = 2 * math.pi - d
d *= 1 if r1 < r2 else -1
return d
@sumsted
sumsted / bigendian.cpp
Created June 8, 2017 11:03
Code for converting host to big endian. Will use for conversion of I2C payload.
#include <stdio.h>
#include <netinet/in.h>
/*
* code for converting host to big endian
* will use for conversion of I2C payload
*/
union Payload {
int value;
@sumsted
sumsted / talon.py
Created January 21, 2017 00:15
Checking talon values
output of below code
current position in degrees: 319
move this many talon units: 484, to get to 130 degrees
checking new position is at 130, 130
-----------------------
def get_position_degrees(talon_units):
@sumsted
sumsted / tox-dep.sh
Created March 13, 2015 11:59
tox and twisted unit test framwork dependencies
#!/bin/bash
# dependencies required for running tox + twisted unit testing framework
# used by scrapy
# ubuntu 14.04
sudo apt-get install aptitude
sudo aptitude install libffi-dev
sudo aptitude install libxml2-dev
sudo aptitude install libxslt-dev