_InteractiveBlockManipulationGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from turtlebot_block_manipulation/InteractiveBlockManipulationGoal.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 InteractiveBlockManipulationGoal(genpy.Message):
00009   _md5sum = "b339dc21a4d30705910c94ca9ed2a4ce"
00010   _type = "turtlebot_block_manipulation/InteractiveBlockManipulationGoal"
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 #goal definition
00014 string frame
00015 float32 block_size
00016 
00017 """
00018   __slots__ = ['frame','block_size']
00019   _slot_types = ['string','float32']
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        frame,block_size
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(InteractiveBlockManipulationGoal, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.frame is None:
00039         self.frame = ''
00040       if self.block_size is None:
00041         self.block_size = 0.
00042     else:
00043       self.frame = ''
00044       self.block_size = 0.
00045 
00046   def _get_types(self):
00047     """
00048     internal API method
00049     """
00050     return self._slot_types
00051 
00052   def serialize(self, buff):
00053     """
00054     serialize message into buffer
00055     :param buff: buffer, ``StringIO``
00056     """
00057     try:
00058       _x = self.frame
00059       length = len(_x)
00060       if python3 or type(_x) == unicode:
00061         _x = _x.encode('utf-8')
00062         length = len(_x)
00063       buff.write(struct.pack('<I%ss'%length, length, _x))
00064       buff.write(_struct_f.pack(self.block_size))
00065     except struct.error as se: self._check_types(se)
00066     except TypeError as te: self._check_types(te)
00067 
00068   def deserialize(self, str):
00069     """
00070     unpack serialized message in str into this message instance
00071     :param str: byte array of serialized message, ``str``
00072     """
00073     try:
00074       end = 0
00075       start = end
00076       end += 4
00077       (length,) = _struct_I.unpack(str[start:end])
00078       start = end
00079       end += length
00080       if python3:
00081         self.frame = str[start:end].decode('utf-8')
00082       else:
00083         self.frame = str[start:end]
00084       start = end
00085       end += 4
00086       (self.block_size,) = _struct_f.unpack(str[start:end])
00087       return self
00088     except struct.error as e:
00089       raise genpy.DeserializationError(e) #most likely buffer underfill
00090 
00091 
00092   def serialize_numpy(self, buff, numpy):
00093     """
00094     serialize message with numpy array types into buffer
00095     :param buff: buffer, ``StringIO``
00096     :param numpy: numpy python module
00097     """
00098     try:
00099       _x = self.frame
00100       length = len(_x)
00101       if python3 or type(_x) == unicode:
00102         _x = _x.encode('utf-8')
00103         length = len(_x)
00104       buff.write(struct.pack('<I%ss'%length, length, _x))
00105       buff.write(_struct_f.pack(self.block_size))
00106     except struct.error as se: self._check_types(se)
00107     except TypeError as te: self._check_types(te)
00108 
00109   def deserialize_numpy(self, str, numpy):
00110     """
00111     unpack serialized message in str into this message instance using numpy for array types
00112     :param str: byte array of serialized message, ``str``
00113     :param numpy: numpy python module
00114     """
00115     try:
00116       end = 0
00117       start = end
00118       end += 4
00119       (length,) = _struct_I.unpack(str[start:end])
00120       start = end
00121       end += length
00122       if python3:
00123         self.frame = str[start:end].decode('utf-8')
00124       else:
00125         self.frame = str[start:end]
00126       start = end
00127       end += 4
00128       (self.block_size,) = _struct_f.unpack(str[start:end])
00129       return self
00130     except struct.error as e:
00131       raise genpy.DeserializationError(e) #most likely buffer underfill
00132 
00133 _struct_I = genpy.struct_I
00134 _struct_f = struct.Struct("<f")


turtlebot_block_manipulation
Author(s): Helen Oleynikova
autogenerated on Thu Dec 12 2013 12:33:52