Skip to content

Instantly share code, notes, and snippets.

View awesomebytes's full-sized avatar

Sam Pfeiffer awesomebytes

View GitHub Profile
pil_image = Image.open('Image.jpg').convert('RGB')
open_cv_image = np.array(pil_image)
# opencv to PIL image
cv2.cvtColor(open_cv_image, cv2.cv.CV_BGR2RGB)
cv2_im = cv2.cvtColor(open_cv_image,cv2.COLOR_BGR2RGB)
pil_im = Image.fromarray(cv2_im)
#pil_im.show()
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import Image, CompressedImage
import fcntl, sys, os
from v4l2 import *
import time
import scipy.misc as misc
import numpy as np
#!/usr/bin/env python
# Author: Sammy Pfeiffer
import rospy
from std_msgs.msg import String
from pal_detection_msgs.msg import PersonDetections, PersonDetection, FaceDetections, FaceDetection
#from pal_user_io_msgs.msg import Input
from pal_control_msgs.msg import MotionManagerActionGoal, MotionManagerAction, MotionManagerGoal
import actionlib
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import rospy
from sensor_msgs.msg import Joy
from control_msgs.msg import JointTrajectoryControllerState
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
JOY_TOPIC = "/joy"
@awesomebytes
awesomebytes / interactive_marker_posestamped.py
Created September 5, 2015 17:39
An interactive marker for publishing a posestamped
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 05/09/15
@author: sampfeiffer
interactive_marker_posestamped.py contains...
"""
__author__ = 'sampfeiffer'
# based on https://github.com/ros-visualization/visualization_tutorials/blob/indigo-devel/interactive_marker_tutorials/scripts/basic_controls.py
@awesomebytes
awesomebytes / test_urdf.md
Last active July 14, 2017 04:13
Test new URDFs fast

start ROS

roscore

Upload robot description urdf to param server

roslaunch marco_description upload_marco.launch

Also:

rosparam set /robot_description "`rosrun xacro xacro.py robot.urdf`"
@awesomebytes
awesomebytes / change_ocurrences.md
Created October 6, 2015 09:05
Change in all directory tree one string for another using find and sed
@awesomebytes
awesomebytes / shell_cmd.py
Last active January 8, 2026 17:59
Spawn a shell with a command with some extra options
#!/usr/bin/env python
import subprocess
import tempfile
import os
import signal
class ShellCmd:
"""Helpful class to spawn commands and keep track of them"""
sam@zenb:~/Pictures/abudhabi/test$ ls -lah
total 2,7M
drwxrwxr-x 2 sam sam 4,0K oct 16 21:25 .
drwxrwxr-x 3 sam sam 4,0K oct 16 21:25 ..
-rw-rw-r-- 1 sam sam 781K oct 16 21:25 2_ar.PNG
-rw-rw-r-- 1 sam sam 150K oct 16 21:25 3_ar.PNG
-rw-rw-r-- 1 sam sam 280K oct 16 21:25 4_ar.PNG
-rw-rw-r-- 1 sam sam 590K oct 16 21:25 5_ar.PNG
-rw-rw-r-- 1 sam sam 493K oct 16 21:25 6_ar.PNG
-rw-rw-r-- 1 sam sam 174K oct 16 21:25 7_ar.PNG
@awesomebytes
awesomebytes / generate_collisions.py
Created November 16, 2015 09:55
Generate all disable collision lines for moveit srdf model in between a list of links
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 11/16/15
@author: sampfeiffer
generate_collisions.py link_1 link_2 link_3
Generates the lines to add to the moveit config <robot>.srdf in