Skip to content

Instantly share code, notes, and snippets.

View danielsnider's full-sized avatar

Daniel Snider danielsnider

View GitHub Profile
@danielsnider
danielsnider / test.cpp
Created November 9, 2012 07:21
test gist
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
{
"kind":"Listing",
"data":{
"modhash":"lwosx1x0c6c85800f1f043f8cc073d7405434319b398d0805b",
"children":[
{
"kind":"t3",
"data":{
"domain":"imgur.com",
"banned_by":null,
@danielsnider
danielsnider / .screenrc.multiwin
Created June 18, 2014 20:00
This GNU Screen config will open 13 terminals and stuff text into some of them to start do this by default. Launch GNU Screen with this command "screen -D -R -S danscreen -c .screenrc.multiwin"
startup_message off
vbell off
defscrollback 5000
#backtick 1 60 60 $HOME/.screenrc.acpi # .screenrc.acpi contains 1 line: acpi | awk -F ', ' '{print $2}'
hardstatus alwayslastline
@danielsnider
danielsnider / xmonad.h
Created June 18, 2014 20:04
Xmonad config with gnome panel and programs which open and move to specific workspaces by default
import XMonad
import XMonad.Config.Gnome
import qualified XMonad.StackSet as W
spawnToWorkspace :: String -> String -> X ()
spawnToWorkspace program workspace = do
spawn program
windows $ W.greedyView workspace
<launch>
<env name="ROSCONSOLE_FORMAT" value="[${thread}] [${node}/${function}:${line}]: ${message}"/>
<node pkg="tf" type="static_transform_publisher" name="swri_transform" args="0 0 0 1.5708 0 0 /world /map 100" />
<node pkg="mapviz" type="mapviz" name="$(anon mapviz)" required="true" output="log"/>
<node pkg="swri_transform_util" type="initialize_origin.py" name="initialize_origin" output="screen">
<param name="local_xy_frame" value="/world"/>
<param name="local_xy_origin" value="auto"/> <!-- "auto" setting will set the origin to the first gps fix that it recieves -->
@danielsnider
danielsnider / automatic_threshold_insulin.m
Last active June 21, 2017 04:40
Automatic Thresholding Using Second Derivative: The threshold is set as the x value of the maximum peak to the right of the max peak of second derivative of ksdensity of insulin pixels. Results: https://youtu.be/sptYuctKS5U
figure;
for n=1:size(img_names,1)
clf
% Load image
img = imread([imgs_path img_names{n}]);
insulin = imgaussfilt(double(img(:,:,2)),10);
cyto = imgaussfilt(double(img(:,:,1)),1);
nuc = imgaussfilt(double(img(:,:,3)),1);
rgb = zeros(size(nuc,1),size(nuc,2),3);
rgb(:,:,1) = cyto;
@danielsnider
danielsnider / kinematics.py
Created August 11, 2017 05:56
Kinematics functions of the Aleph 0 Rover. The logic is a little bit mixed up. This class should only compute the kinematics, but it also is used to publish messages to ROS.
from math import sin, cos, atan2, sqrt, acos, pi
import rospy
import numpy
import tf
from sensor_msgs.msg import JointState
class UnreachablePositionError(Exception):
pass
@danielsnider
danielsnider / kinematics.py
Last active June 29, 2019 20:09
Kinematics functions of the Aleph 0 Rover. The logic is a little bit mixed up. This class should only compute the kinematics, but it also is used to publish messages to ROS. http://continuum.uni.wroc.pl/ Copyright Michał Barciś
from math import sin, cos, atan2, sqrt, acos, pi
import rospy
import numpy
import tf
from sensor_msgs.msg import JointState
class UnreachablePositionError(Exception):
pass
@danielsnider
danielsnider / set_robot_as_ROS_master.sh
Last active August 26, 2017 17:43
Team R3 has developed a script to automatically set your ROS_IP environment variable and to detect an online robot using ping and set your ROS_MASTER_URI environment variable (assumes a static IP for your robot). If your robot is not online your own ROS_IP will be used in your ROS_MASTER_URI. To use this script run 'source ~/set_robot_as_ROS_mas…
#!/bin/bash
# Get my IP
MY_IP=$(hostname -I | grep 192.168.137 | cut -f1 -d' ')
exit_status=$?
if [ $exit_status -eq 1 ]; then
echo "ERROR: you do not have an IP on the robot network (192.168.137.x). Please set one. Aborting..."
return 1
fi
@danielsnider
danielsnider / gist:7a7faeeef43646b109514dd680349903
Created April 9, 2018 23:20
Embed an image in a GitHub README.md
<p align="center">
<img src="https://github.com/danielsnider/ros-rover/blob/master/diagrams/book_cover.png?raw=true" alt="Drawing" height="400px">
</p>