Skip to content

Instantly share code, notes, and snippets.

View kscottz's full-sized avatar
💭
🐀 🫡 🛠️

Katherine Scott kscottz

💭
🐀 🫡 🛠️
View GitHub Profile
@kscottz
kscottz / setup_robot.sh
Last active December 31, 2015 01:29
Setup my robot environment.
#!/bin/bash
echo "sourcing ros setup..."
source ~/development_ws/devel/setup.bash
echo "setting ros uri..."
export ROS_IP=192.168.1.42
echo "setting git user..."
DEVDIR='/home/ros/development_ws/src'
for dir in `ls $DEVDIR`;
do
cd $DEVDIR
kscottz@JeanGrey:~/Essess/chef$ ./setup.sh
-----
Checking ruby version
-----
Checking vagrant installation
-----
VirtualBox or VMWare must also be installed!
-----
Installing vagrant plugins
Installing the 'vagrant-berkshelf' plugin. This can take a few minutes...
@kscottz
kscottz / gist:6320382
Created August 23, 2013 15:05
Installing pygame on a beagle bone black running Ubuntu 13.04
sudo apt-get install libsdl-net1.2-dev libsdl-mixer1.2-dev libsmpeg-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-gfx1.2-dev libsdl-pango-dev
sudo apt-get install libv4l-dev
sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h
wget http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz
tar -xvf pygame-1.9.1release.tar.gz
cd pygame-1.9.1release
sudo python setup.py install
@kscottz
kscottz / dewarp.py
Created August 11, 2013 20:03
Dewarping 360 degree video using python.
from SimpleCV import Camera, VideoStream, Color, Display, Image, VirtualCamera
import cv2
import numpy as np
import time
# build the mapping
def buildMap(Ws,Hs,Wd,Hd,R1,R2,Cx,Cy):
map_x = np.zeros((Hd,Wd),np.float32)
map_y = np.zeros((Hd,Wd),np.float32)
for y in range(0,int(Hd-1)):
@kscottz
kscottz / DeMagicEye.py
Created July 10, 2013 05:21
Generate a depth map from a "Magic Eye" random dot autostereogram.
from SimpleCV import Image, Display, Color
from multiprocessing import Process, Queue
import numpy as np
import cv2
import copy
import sys
# caclulate the value of a row
# using the integral image
def idxToSum(x1,x2,y,integral):
# assume x2 > x1
kscottz@kscottz-laptop:~/Code/tapsterbot/src$
kscottz@kscottz-laptop:~/Code/tapsterbot/src$ sudo npm install
npm http GET https://registry.npmjs.org/grunt-contrib-jshint
npm http GET https://registry.npmjs.org/socket.io/0.9.11
npm http GET https://registry.npmjs.org/sylvester/0.0.21
npm http GET https://registry.npmjs.org/grunt-template-jasmine-requirejs
npm http GET https://registry.npmjs.org/grunt-contrib-jasmine
npm http GET https://registry.npmjs.org/grunt
npm http 304 https://registry.npmjs.org/socket.io/0.9.11
@kscottz
kscottz / TweetTweets.py
Created July 1, 2013 05:50
A quick hack to post a sound to soundcloud and then tweet about the post. You need all the developer keys and such. Uses the SoundCloud python library, and this twitter python library. https://github.com/bear/python-twitter. This is a good tutorial: http://wilsonericn.wordpress.com/2011/08/22/tweeting-in-python-the-easy-way/
import soundcloud
import twitter
sc_id ="your_id"
sc_secret = "your_sc_secret"
sc_un = "sound_cloud_username"
sc_pw = "sound_cloud_pw"
sound_file = 'temp.wav'
sound_name = 'A real tweet'
client = soundcloud.Client(client_id=sc_id,
client_secret=sc_secret,
@kscottz
kscottz / mp32np.py
Created July 1, 2013 04:29
Convert mp3 to numpy array. Ugly, but it works.
import os
import scipy.io.wavfile as wav
# install lame
# install bleeding edge scipy (needs new cython)
fname = 'XC135672-Red-winged\ Blackbird1301.mp3'
oname = 'temp.wav'
cmd = 'lame --decode {0} {1}'.format( fname,oname )
os.system(cmd)
data = wav.read(oname)
# your code goes here
@kscottz
kscottz / CallCenter.py
Created June 28, 2013 04:16
Script to grab audio from a microphone and display the results using matplotlib.
from array import array
import pyaudio
import sys
import numpy as np
import matplotlib.pyplot as plt
chunk = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
#RATE = 44100
@kscottz
kscottz / CallCenter.py
Created June 28, 2013 03:59
Script to grab audio from a microphone and display the results using matplotlib.
from array import array
import pyaudio
import sys
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
ax1=plt.axes()
chunk = 1024
FORMAT = pyaudio.paInt16