_HapticMpcState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/HapticMpcState.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import std_msgs.msg
00008 
00009 class HapticMpcState(genpy.Message):
00010   _md5sum = "a381014c8b4accba10ebc670d3fdfb0f"
00011   _type = "hrl_haptic_manipulation_in_clutter_msgs/HapticMpcState"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 
00015 string[] state
00016 string[] error
00017 
00018 
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data 
00023 # in a particular coordinate frame.
00024 # 
00025 # sequence ID: consecutively increasing ID 
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036 
00037 """
00038   __slots__ = ['header','state','error']
00039   _slot_types = ['std_msgs/Header','string[]','string[]']
00040 
00041   def __init__(self, *args, **kwds):
00042     """
00043     Constructor. Any message fields that are implicitly/explicitly
00044     set to None will be assigned a default value. The recommend
00045     use is keyword arguments as this is more robust to future message
00046     changes.  You cannot mix in-order arguments and keyword arguments.
00047 
00048     The available fields are:
00049        header,state,error
00050 
00051     :param args: complete set of field values, in .msg order
00052     :param kwds: use keyword arguments corresponding to message field names
00053     to set specific fields.
00054     """
00055     if args or kwds:
00056       super(HapticMpcState, self).__init__(*args, **kwds)
00057       #message fields cannot be None, assign default values for those that are
00058       if self.header is None:
00059         self.header = std_msgs.msg.Header()
00060       if self.state is None:
00061         self.state = []
00062       if self.error is None:
00063         self.error = []
00064     else:
00065       self.header = std_msgs.msg.Header()
00066       self.state = []
00067       self.error = []
00068 
00069   def _get_types(self):
00070     """
00071     internal API method
00072     """
00073     return self._slot_types
00074 
00075   def serialize(self, buff):
00076     """
00077     serialize message into buffer
00078     :param buff: buffer, ``StringIO``
00079     """
00080     try:
00081       _x = self
00082       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00083       _x = self.header.frame_id
00084       length = len(_x)
00085       if python3 or type(_x) == unicode:
00086         _x = _x.encode('utf-8')
00087         length = len(_x)
00088       buff.write(struct.pack('<I%ss'%length, length, _x))
00089       length = len(self.state)
00090       buff.write(_struct_I.pack(length))
00091       for val1 in self.state:
00092         length = len(val1)
00093         if python3 or type(val1) == unicode:
00094           val1 = val1.encode('utf-8')
00095           length = len(val1)
00096         buff.write(struct.pack('<I%ss'%length, length, val1))
00097       length = len(self.error)
00098       buff.write(_struct_I.pack(length))
00099       for val1 in self.error:
00100         length = len(val1)
00101         if python3 or type(val1) == unicode:
00102           val1 = val1.encode('utf-8')
00103           length = len(val1)
00104         buff.write(struct.pack('<I%ss'%length, length, val1))
00105     except struct.error as se: self._check_types(se)
00106     except TypeError as te: self._check_types(te)
00107 
00108   def deserialize(self, str):
00109     """
00110     unpack serialized message in str into this message instance
00111     :param str: byte array of serialized message, ``str``
00112     """
00113     try:
00114       if self.header is None:
00115         self.header = std_msgs.msg.Header()
00116       end = 0
00117       _x = self
00118       start = end
00119       end += 12
00120       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00121       start = end
00122       end += 4
00123       (length,) = _struct_I.unpack(str[start:end])
00124       start = end
00125       end += length
00126       if python3:
00127         self.header.frame_id = str[start:end].decode('utf-8')
00128       else:
00129         self.header.frame_id = str[start:end]
00130       start = end
00131       end += 4
00132       (length,) = _struct_I.unpack(str[start:end])
00133       self.state = []
00134       for i in range(0, length):
00135         start = end
00136         end += 4
00137         (length,) = _struct_I.unpack(str[start:end])
00138         start = end
00139         end += length
00140         if python3:
00141           val1 = str[start:end].decode('utf-8')
00142         else:
00143           val1 = str[start:end]
00144         self.state.append(val1)
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       self.error = []
00149       for i in range(0, length):
00150         start = end
00151         end += 4
00152         (length,) = _struct_I.unpack(str[start:end])
00153         start = end
00154         end += length
00155         if python3:
00156           val1 = str[start:end].decode('utf-8')
00157         else:
00158           val1 = str[start:end]
00159         self.error.append(val1)
00160       return self
00161     except struct.error as e:
00162       raise genpy.DeserializationError(e) #most likely buffer underfill
00163 
00164 
00165   def serialize_numpy(self, buff, numpy):
00166     """
00167     serialize message with numpy array types into buffer
00168     :param buff: buffer, ``StringIO``
00169     :param numpy: numpy python module
00170     """
00171     try:
00172       _x = self
00173       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00174       _x = self.header.frame_id
00175       length = len(_x)
00176       if python3 or type(_x) == unicode:
00177         _x = _x.encode('utf-8')
00178         length = len(_x)
00179       buff.write(struct.pack('<I%ss'%length, length, _x))
00180       length = len(self.state)
00181       buff.write(_struct_I.pack(length))
00182       for val1 in self.state:
00183         length = len(val1)
00184         if python3 or type(val1) == unicode:
00185           val1 = val1.encode('utf-8')
00186           length = len(val1)
00187         buff.write(struct.pack('<I%ss'%length, length, val1))
00188       length = len(self.error)
00189       buff.write(_struct_I.pack(length))
00190       for val1 in self.error:
00191         length = len(val1)
00192         if python3 or type(val1) == unicode:
00193           val1 = val1.encode('utf-8')
00194           length = len(val1)
00195         buff.write(struct.pack('<I%ss'%length, length, val1))
00196     except struct.error as se: self._check_types(se)
00197     except TypeError as te: self._check_types(te)
00198 
00199   def deserialize_numpy(self, str, numpy):
00200     """
00201     unpack serialized message in str into this message instance using numpy for array types
00202     :param str: byte array of serialized message, ``str``
00203     :param numpy: numpy python module
00204     """
00205     try:
00206       if self.header is None:
00207         self.header = std_msgs.msg.Header()
00208       end = 0
00209       _x = self
00210       start = end
00211       end += 12
00212       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00213       start = end
00214       end += 4
00215       (length,) = _struct_I.unpack(str[start:end])
00216       start = end
00217       end += length
00218       if python3:
00219         self.header.frame_id = str[start:end].decode('utf-8')
00220       else:
00221         self.header.frame_id = str[start:end]
00222       start = end
00223       end += 4
00224       (length,) = _struct_I.unpack(str[start:end])
00225       self.state = []
00226       for i in range(0, length):
00227         start = end
00228         end += 4
00229         (length,) = _struct_I.unpack(str[start:end])
00230         start = end
00231         end += length
00232         if python3:
00233           val1 = str[start:end].decode('utf-8')
00234         else:
00235           val1 = str[start:end]
00236         self.state.append(val1)
00237       start = end
00238       end += 4
00239       (length,) = _struct_I.unpack(str[start:end])
00240       self.error = []
00241       for i in range(0, length):
00242         start = end
00243         end += 4
00244         (length,) = _struct_I.unpack(str[start:end])
00245         start = end
00246         end += length
00247         if python3:
00248           val1 = str[start:end].decode('utf-8')
00249         else:
00250           val1 = str[start:end]
00251         self.error.append(val1)
00252       return self
00253     except struct.error as e:
00254       raise genpy.DeserializationError(e) #most likely buffer underfill
00255 
00256 _struct_I = genpy.struct_I
00257 _struct_3I = struct.Struct("<3I")


hrl_haptic_manipulation_in_clutter_msgs
Author(s): Advait Jain, Marc Killpack, Jeff Hawke. Advisor: Prof. Charlie Kemp. Healthcare Robotics Lab, Georgia Tech.
autogenerated on Wed Nov 27 2013 11:33:37