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 signal | |
import socket | |
import time | |
class TeleopController(): | |
UDP_ADDRESS = '192.168.1.58' | |
UDP_PORT = 8484 | |
MESSAGE = "%04d%04d%04d" |
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 json | |
import redis | |
class RoverShare: | |
host = '192.168.3.9' | |
port = 6379 | |
command_queue_key = 'vision_command_queue' | |
location_key = 'location' |
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
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 |
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
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 | |
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
#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; |
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
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): |
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
#!/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 |