Skip to content

Instantly share code, notes, and snippets.

View awesomebytes's full-sized avatar

Sam Pfeiffer awesomebytes

View GitHub Profile
def msg_to_list(message):
"""
Given a message, e.g.: Vector3(x=0.0, y=0.0, z=0.0)
returns the list of it's slots, e.g.: [0.0, 0.0, 0.0]
:param message: some message that we want it's slots into a list
:return: the slots as a list
"""
output_list = []
for slot in message.__slots__:
output_list.append(message.__getattribute__(slot))
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 6/5/15
@author: sampfeiffer
create_drc_web.py contains...
"""
__author__ = 'sampfeiffer'
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 6/9/15
@author: sampfeiffer
top_subprocess.py contains...
"""
__author__ = 'sampfeiffer'
'''
@author: Sammy Pfeiffer
Plot current weights
'''
import rospy
from std_msgs.msg import Float64MultiArray
import matplotlib.pyplot as plt
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 6/16/15
@author: Sammy Pfeiffer
try_get_topic_class.py contains a little test
demonstrating that get_topic_class from rostopic
does not give the original name of a topic given a
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 6/16/15
@author: sampfeiffer
test_get_original_topic.py contains...
"""
__author__ = 'sampfeiffer'
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 6/19/15
@author: sampfeiffer
exponential_array_creator.py contains...
"""
__author__ = 'sampfeiffer'
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import LaserScan
import numpy as np
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 7/29/15
@author: sampfeiffer
shirt_color.py contains...
"""
__author__ = 'sampfeiffer'
#! /usr/bin/env python
import Image, ImageEnhance
def reduce_opacity(im, opacity):
"""Returns an image with reduced opacity."""
assert opacity >= 0 and opacity <= 1
if im.mode != 'RGBA':
im = im.convert('RGBA')
else:
im = im.copy()