<commit_before>#!/usr/bin/env python
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
import os 
import sys
from sensor_msgs.msg import PointCloud2


class StorePictureState(EventState):
	'''
	Stores the picture to the local home folder.

	># Image    Image       The received Image
	<= done             The picture has been received and stored.

	'''

	def __init__(self):
		super(StorePictureState, self).__init__(outcomes = ['done'],    input_keys = ['Image'])
				

	def execute(self, userdata):
		return 'done'

	def on_enter(self,userdata):

		cv_image = CvBridge.imgmsg_to_cv2(userdata, desired_encoding="passthrough")
		filename = os.path.expanduser('~/picture_'+str(rospy.Time.now()))
		cv2.imwrite(filename,cv_image)
		print 'Picture has been saved to the home folder'   
<commit_msg>image message type fixeed<commit_after>#!/usr/bin/env python
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
import os 
import sys
from sensor_msgs.msg import PointCloud2


class StorePictureState(EventState):
	'''
	Stores the picture to the local home folder.

	># Image    Image       The received Image
	<= done             The picture has been received and stored.

	'''

	def __init__(self):
		super(StorePictureState, self).__init__(outcomes = ['done'],    input_keys = ['Image'])
				

	def execute(self, userdata):
		return 'done'

	def on_enter(self,userdata):
		bridge =  CvBridge()
		cv_image = bridge.imgmsg_to_cv2(userdata.Image, desired_encoding="passthrough")
		filename = os.path.expanduser('~/picture_'+str(rospy.Time.now()))
		cv2.imwrite(filename,cv_image)
		print 'Picture has been saved to the home folder'   

{'fraction_non_alphanumeric': 0.09345794392523364, 'fraction_numerical': 0.004153686396677051, 'mean_word_length': 4.537356321839081, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3425950', 'n_tokens_mistral': 654, 'n_tokens_neox': 601, 'n_words': 173}