Skip to content

Instantly share code, notes, and snippets.

Avatar

Raaj soulslicer

  • Carnegie Mellon University Robotics Institute
View GitHub Profile
View xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 331.62 (buildmeister@swio-display-x64-rhel04-19) Wed Mar 19 18:42:16 PDT 2014
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
View rmap.m
clear ; close all; clc
sonarmap = importdata('sonarmap.mat');
A=[];b=[];
xarr = [];yarr = [];rarr = [];tarr = [];
for i=1:size(sonarmap,1),
x = sonarmap(i,1) - 196;
@soulslicer
soulslicer / capture.cpp
Last active Aug 29, 2015
C920 Capture header
View capture.cpp
//#define DEBUG
#define MB(x) (x*1024*1024)
#include "c920capture.h"
//Callback for process frame
int process_frame(void* data, size_t length, c920_parameters_t c920_parameters)
{
static long bytes = 0;
static long fcount = 0;
View thetamap.m
clear ; close all; clc
sonarmap = importdata('sonarmap.mat');
A=[];b=[];
xarr = [];yarr = [];rarr = [];tarr = [];
for i=1:size(sonarmap,1),
x = sonarmap(i,1) - 196;
y = 479 - sonarmap(i,2);
View sonar-rtheta
bool sonar_pixel(sonar::sonar_pixel::Request &req, sonar::sonar_pixel::Response &rsp)
{
int row = ((double)(req.y) / HEIGHT) * BVTMagImage_GetHeight(rangeImage);
int col = ((double)(req.x) / WIDTH) * BVTMagImage_GetWidth(rangeImage);
rsp.range = BVTMagImage_GetPixelRange(rangeImage, (int)row, (int)col);
rsp.bearing = BVTMagImage_GetPixelRelativeBearing(rangeImage, (int)row, (int)col);
ROS_INFO("range bearing for pixel [%d %d] = [%f %f]", req.x, req.y, rsp.range, rsp.bearing);
}
View gist:18c651dd443c1a9216bb
gst-launch -ev \
v4l2src device=/dev/video4 ! video/x-raw-yuv,width=1792,height=768 \ ! tee name=pip ! queue ! videorate ! video/x-raw-yuv,framerate=25/1 \ ! videocrop left=1024 bottom=192 ! video/x-raw-yuv,framerate=25/1 \
! xvidenc bitrate=2000000 max-key-interval=25 ! video/mpeg,framerate=25/1 \ ! avimux ! filesink location=/tmp/video.avi \
pip. ! queue ! videorate ! video/x-raw-yuv,framerate=5/1 \ ! videocrop right=768 ! video/x-raw-yuv,framerate=5/1 \
! xvidenc bitrate=1000000 max-key-interval=5 ! video/mpeg,framerate=5/1 \ ! avimux ! filesink location=/tmp/grabber.avi \
alsasrc device=hw:0 ! audio/x-raw-int,rate=44100,channels=2,depth=16 \ ! queue ! lamemp3enc target=bitrate cbr=true bitrate=128 \
! avimux ! filesink location=/tmp/audio.avi
View gist:c9b7503b3eac504f0257
/usr/local/bin/gst-launch-1.0 uvch264src fixed-framerate=1 iframe-period=30000
initial-bitrate=500000 peak-bitrate=500000 num-reorder-frames=20 device=/dev/video0 name=src auto-start=true num-buffers=300 src.vfsrc ! queue ! fakesink src.vidsrc ! queue ! video/x-h264,width=1280,height=720,framerate=30/1,format=GRAY8 ! h264parse ! qtmux ! filesink location=video.mp4
gst-launch-1.0 uvch264src fixed-framerate=1 iframe-period=30000 initial-bitrate=500000 peak-bitrate=500000 num-reorder-frames=20 -e filesrc location="output.raw" ! h264parse ! qtmux ! filesink location=video.mp4
View gist:bcad1ce13f179b99ad52
gst-launch -ev \
alsasrc device=hw:0 ! audio/x-raw-int,rate=44100,channels=2,depth=16 \ ! queue ! lamemp3enc target=bitrate cbr=true bitrate=128 \
! tee name=audio ! queue ! video. \ audio. ! queue ! grabber. \
v4l2src device=/dev/video4 ! video/x-raw-yuv,width=1792,height=768 \ ! tee name=pip ! queue ! videorate ! video/x-raw-yuv,framerate=25/1 \ ! videocrop left=1024 bottom=192 ! video/x-raw-yuv,framerate=25/1 \
! xvidenc bitrate=2000000 max-key-interval=25 ! video/mpeg,framerate=25/1 \ ! queue ! video. \
pip. ! queue ! videorate ! video/x-raw-yuv,framerate=5/1 \ ! videocrop right=768 ! video/x-raw-yuv,framerate=5/1 \
! xvidenc bitrate=1000000 max-key-interval=5 ! video/mpeg,framerate=5/1 \ ! queue ! grabber. \
View qt-pyquery problem
from pyquery import PyQuery as pq
from PyQt4 import QtCore
import multiprocessing
import time
data = (
['a', '2'],
)
@soulslicer
soulslicer / ubuntu_agnoster_install.md
Created May 5, 2016 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 14.04 + Terminator + Oh My ZSH with Agnoster Theme
View ubuntu_agnoster_install.md

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH