Skip to content

Instantly share code, notes, and snippets.

View harmishhk's full-sized avatar

Harmish Khambhaita harmishhk

View GitHub Profile
@harmishhk
harmishhk / following-graphs
Last active August 29, 2015 14:23
human-robot following graphs
# human-robot following graphs
@harmishhk
harmishhk / hanp_laser_filter_plot.jl
Last active August 29, 2015 14:25
plot test laser scan data and human
using Gadfly
using Cairo
# generate scan data
angle_min = -1.5;
angle_max = 1.5;
angle_increment = 0.1;
ranges = [5.0, 5.0, 4.5, 4.0, 3.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 4.5, 4.0, 3.5, 3.0, 3.5, 4.0, 4.5, 5.0]
# put a human
human = [1.5, 2.5]
using Gadfly
using Cairo
max_wheel_vel = 1.6
wheel_base = 0.78
calc_step = 0.01
arcs = Array(Float64, 0, 2)
data = Array(Float64, 0, 2)
using Gadfly
using Cairo
lin_vel = 0.3
ang_vel = -π/4
scale_setp = 0.2
time_step = 0.05
trajectories = Array(Float64, convert(Int32, 1/time_step),2,0)
using Gadfly
points = [100 112; 500 23.25; 1000 12.05; 2000 6.5; 3000 4.65; 4000 3.8; 5000 3.2; 6000 2.8; 7000 2.55; 8000 2.35; 9000 2.2; 10000 2.1; 11000 2.0; 12000 1.9]
p = plot(x=points[:,1], y=points[:,2], Geom.point)
velocities = [100 0.044642857; 500 0.215053763; 1000 0.414937759; 2000 0.769230769; 3000 1.075268817; 4000 1.315789474; 5000 1.5625; 6000 1.785714286; 7000 1.960784314; 8000 2.127659574; 9000 2.272727273; 12000 2.631578947]
pv = plot(x=velocities[:,1], y=velocities[:,2], Geom.point)
@harmishhk
harmishhk / git_author_reset
Last active January 1, 2016 17:52
git-scripts
git filter-branch -f --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "old@email.com" ]
then
cn="author name"
@harmishhk
harmishhk / set_ros_ip
Created January 2, 2016 16:18
ros scripts
export ROS_IP=`ifconfig eth0 | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}'`
if [ -z "$ROS_IP" ]; then
export ROS_IP=`ifconfig wlan0 | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}'`
fi
if [ -z "$ROS_IP" ]; then
export ROS_IP="127.0.0.1"
fi
@harmishhk
harmishhk / install_gazebo.sh
Last active January 18, 2016 20:54
install gazebo 6 from source on ubuntu 14.04
#!/bin/bash
CURRENT_DIR=$(pwd)
# add gazebo repo
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list' || { exit 1; }
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - || { exit 1; }
sudo apt-get update || { exit 1; }
# install dependencies
@harmishhk
harmishhk / lumia_gps_metadata_copy.ps1
Created April 13, 2016 17:03
powershell script to copy gps-metadata between image files
# script to copy GPS metadata between files based on names.
# implemented for photos from Lumia 1020 phone which stores images in two sizes,
# one of them (low resolution image) has GPS but the other (high resolution image) does not!
# requires ExifTool: http://www.sno.phy.queensu.ca/~phil/exiftool
# author: Harmish Khambhaita, v0.1, 13/04/2016
# specify directory to process photos
$rootFolder = "C:\Users\your_name\Pictures\lumia_1020"
# specify location for exiftool
# #!/bin/bash -eux
code --install-extension DotJoshJohnson.xml
code --install-extension EditorConfig.EditorConfig
code --install-extension PeterJausovec.vscode-docker
code --install-extension UCL.haskelly
code --install-extension ajshort.msg
code --install-extension cssho.vscode-svgviewer
code --install-extension donjayamanne.githistory
code --install-extension donjayamanne.python