Skip to content

Instantly share code, notes, and snippets.

@kor01
kor01 / rosed.sh
Created June 26, 2017 14:01
[ros edit] edit ros files #ros
rosed [package_name] [filename]
rosed roscpp Logger.msg
# list all editable files
rosed [package_name] <tab><tab>
# set editor
export EDITOR='emacs -nw'
@kor01
kor01 / record_bag.sh
Created June 26, 2017 14:42
[ros record] record ros bag files #ros
# record a replay
mkdir relay
cd relay
rosbag record -a
# play back
rosbag play my_bag_files
# twice as fast
@kor01
kor01 / rviz_tips.txt
Created June 26, 2017 23:00
[ros rviz] ros visualization #ros
tune alpha value to show axis
@kor01
kor01 / array_operation.m
Created July 25, 2017 00:52
[matlab array] matlab array operations #matlab
%% get size
d = size(a, 2)
e = size(a, 1)
%% drop singleton dimension
a = squeeze(b)
%% construct
@kor01
kor01 / plot_bar.py
Last active August 16, 2017 23:11
[matplot cheet] subplot bars #matplot
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
# Read in and plot the image
image = mpimg.imread('Udacican.jpeg')
plt.imshow(image)
# Take histograms in R, G, and B
@kor01
kor01 / find_corners.py
Last active August 20, 2017 08:37
[cv2 cheatsheet] #cv2
# number of inner corners in x and y direction
nx = 8
ny = 6
#find chessboard corners
img = mpimg.imread(images[idx])
# Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
@kor01
kor01 / car_classify.py
Last active August 16, 2017 23:20
[scikit-learn] scikit cheets #scikit
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
import time
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
# NOTE: the next import is only valid
# for scikit-learn version <= 0.17
@kor01
kor01 / run_test.sh
Created August 23, 2017 04:06
[nosetest cheatsheet] nosetest #nosetest
nosetests --logging-level=WARN -vs
@kor01
kor01 / quadrotor_pitches.txt
Last active August 27, 2017 06:35
[mechanic conventions] rotation orientation #mechanics
from the rotor center:
the pitch surface in phase II and IV: up rotation produce up thrust on the body
the pitch surface in phase I and III: up rotation produce down thrust on the body
up rotation always produce down torque
down rotation produce up torque
@kor01
kor01 / 001_perception_sensors.txt
Last active August 29, 2017 23:37
[RoboND_Sensors] brief course notes #robotics
human v.s. robots:
human 3D vision: stereo vision, prior geometry, motion filtering
robot 3D vision: (actively) measure the distance
sensor types:
active sensors: use an enery source to probe the environment