_ImageSnapshotGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_image_snapshot_recorder/ImageSnapshotGoal.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class ImageSnapshotGoal(genpy.Message):
00009   _md5sum = "13e4842bc6386877d90e53523f6d94ba"
00010   _type = "pr2_image_snapshot_recorder/ImageSnapshotGoal"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 string topic_name # Topic name, must be of sensor_msgs/Image
00014 int32 num_images # Set <0 to record until prempted
00015 string output_file_name # Default: /hwlog/TOPIC_NAME_DATE_TIME.bag
00016 
00017 """
00018   __slots__ = ['topic_name','num_images','output_file_name']
00019   _slot_types = ['string','int32','string']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        topic_name,num_images,output_file_name
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(ImageSnapshotGoal, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.topic_name is None:
00039         self.topic_name = ''
00040       if self.num_images is None:
00041         self.num_images = 0
00042       if self.output_file_name is None:
00043         self.output_file_name = ''
00044     else:
00045       self.topic_name = ''
00046       self.num_images = 0
00047       self.output_file_name = ''
00048 
00049   def _get_types(self):
00050     """
00051     internal API method
00052     """
00053     return self._slot_types
00054 
00055   def serialize(self, buff):
00056     """
00057     serialize message into buffer
00058     :param buff: buffer, ``StringIO``
00059     """
00060     try:
00061       _x = self.topic_name
00062       length = len(_x)
00063       if python3 or type(_x) == unicode:
00064         _x = _x.encode('utf-8')
00065         length = len(_x)
00066       buff.write(struct.pack('<I%ss'%length, length, _x))
00067       buff.write(_struct_i.pack(self.num_images))
00068       _x = self.output_file_name
00069       length = len(_x)
00070       if python3 or type(_x) == unicode:
00071         _x = _x.encode('utf-8')
00072         length = len(_x)
00073       buff.write(struct.pack('<I%ss'%length, length, _x))
00074     except struct.error as se: self._check_types(se)
00075     except TypeError as te: self._check_types(te)
00076 
00077   def deserialize(self, str):
00078     """
00079     unpack serialized message in str into this message instance
00080     :param str: byte array of serialized message, ``str``
00081     """
00082     try:
00083       end = 0
00084       start = end
00085       end += 4
00086       (length,) = _struct_I.unpack(str[start:end])
00087       start = end
00088       end += length
00089       if python3:
00090         self.topic_name = str[start:end].decode('utf-8')
00091       else:
00092         self.topic_name = str[start:end]
00093       start = end
00094       end += 4
00095       (self.num_images,) = _struct_i.unpack(str[start:end])
00096       start = end
00097       end += 4
00098       (length,) = _struct_I.unpack(str[start:end])
00099       start = end
00100       end += length
00101       if python3:
00102         self.output_file_name = str[start:end].decode('utf-8')
00103       else:
00104         self.output_file_name = str[start:end]
00105       return self
00106     except struct.error as e:
00107       raise genpy.DeserializationError(e) #most likely buffer underfill
00108 
00109 
00110   def serialize_numpy(self, buff, numpy):
00111     """
00112     serialize message with numpy array types into buffer
00113     :param buff: buffer, ``StringIO``
00114     :param numpy: numpy python module
00115     """
00116     try:
00117       _x = self.topic_name
00118       length = len(_x)
00119       if python3 or type(_x) == unicode:
00120         _x = _x.encode('utf-8')
00121         length = len(_x)
00122       buff.write(struct.pack('<I%ss'%length, length, _x))
00123       buff.write(_struct_i.pack(self.num_images))
00124       _x = self.output_file_name
00125       length = len(_x)
00126       if python3 or type(_x) == unicode:
00127         _x = _x.encode('utf-8')
00128         length = len(_x)
00129       buff.write(struct.pack('<I%ss'%length, length, _x))
00130     except struct.error as se: self._check_types(se)
00131     except TypeError as te: self._check_types(te)
00132 
00133   def deserialize_numpy(self, str, numpy):
00134     """
00135     unpack serialized message in str into this message instance using numpy for array types
00136     :param str: byte array of serialized message, ``str``
00137     :param numpy: numpy python module
00138     """
00139     try:
00140       end = 0
00141       start = end
00142       end += 4
00143       (length,) = _struct_I.unpack(str[start:end])
00144       start = end
00145       end += length
00146       if python3:
00147         self.topic_name = str[start:end].decode('utf-8')
00148       else:
00149         self.topic_name = str[start:end]
00150       start = end
00151       end += 4
00152       (self.num_images,) = _struct_i.unpack(str[start:end])
00153       start = end
00154       end += 4
00155       (length,) = _struct_I.unpack(str[start:end])
00156       start = end
00157       end += length
00158       if python3:
00159         self.output_file_name = str[start:end].decode('utf-8')
00160       else:
00161         self.output_file_name = str[start:end]
00162       return self
00163     except struct.error as e:
00164       raise genpy.DeserializationError(e) #most likely buffer underfill
00165 
00166 _struct_I = genpy.struct_I
00167 _struct_i = struct.Struct("<i")


pr2_image_snapshot_recorder
Author(s): Kevin Watts
autogenerated on Thu Nov 28 2013 11:46:48