_Skeleton.py
Go to the documentation of this file.
00001 """autogenerated by genpy from skeleton_markers/Skeleton.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 geometry_msgs.msg
00008 import std_msgs.msg
00009 
00010 class Skeleton(genpy.Message):
00011   _md5sum = "34722af981b6a61700ff31df5a97c2e0"
00012   _type = "skeleton_markers/Skeleton"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 int32 user_id
00016 string[] name
00017 float32[] confidence
00018 geometry_msgs/Vector3[] position
00019 geometry_msgs/Quaternion[] orientation
00020 
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data 
00025 # in a particular coordinate frame.
00026 # 
00027 # sequence ID: consecutively increasing ID 
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038 
00039 ================================================================================
00040 MSG: geometry_msgs/Vector3
00041 # This represents a vector in free space. 
00042 
00043 float64 x
00044 float64 y
00045 float64 z
00046 ================================================================================
00047 MSG: geometry_msgs/Quaternion
00048 # This represents an orientation in free space in quaternion form.
00049 
00050 float64 x
00051 float64 y
00052 float64 z
00053 float64 w
00054 
00055 """
00056   __slots__ = ['header','user_id','name','confidence','position','orientation']
00057   _slot_types = ['std_msgs/Header','int32','string[]','float32[]','geometry_msgs/Vector3[]','geometry_msgs/Quaternion[]']
00058 
00059   def __init__(self, *args, **kwds):
00060     """
00061     Constructor. Any message fields that are implicitly/explicitly
00062     set to None will be assigned a default value. The recommend
00063     use is keyword arguments as this is more robust to future message
00064     changes.  You cannot mix in-order arguments and keyword arguments.
00065 
00066     The available fields are:
00067        header,user_id,name,confidence,position,orientation
00068 
00069     :param args: complete set of field values, in .msg order
00070     :param kwds: use keyword arguments corresponding to message field names
00071     to set specific fields.
00072     """
00073     if args or kwds:
00074       super(Skeleton, self).__init__(*args, **kwds)
00075       #message fields cannot be None, assign default values for those that are
00076       if self.header is None:
00077         self.header = std_msgs.msg.Header()
00078       if self.user_id is None:
00079         self.user_id = 0
00080       if self.name is None:
00081         self.name = []
00082       if self.confidence is None:
00083         self.confidence = []
00084       if self.position is None:
00085         self.position = []
00086       if self.orientation is None:
00087         self.orientation = []
00088     else:
00089       self.header = std_msgs.msg.Header()
00090       self.user_id = 0
00091       self.name = []
00092       self.confidence = []
00093       self.position = []
00094       self.orientation = []
00095 
00096   def _get_types(self):
00097     """
00098     internal API method
00099     """
00100     return self._slot_types
00101 
00102   def serialize(self, buff):
00103     """
00104     serialize message into buffer
00105     :param buff: buffer, ``StringIO``
00106     """
00107     try:
00108       _x = self
00109       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00110       _x = self.header.frame_id
00111       length = len(_x)
00112       if python3 or type(_x) == unicode:
00113         _x = _x.encode('utf-8')
00114         length = len(_x)
00115       buff.write(struct.pack('<I%ss'%length, length, _x))
00116       buff.write(_struct_i.pack(self.user_id))
00117       length = len(self.name)
00118       buff.write(_struct_I.pack(length))
00119       for val1 in self.name:
00120         length = len(val1)
00121         if python3 or type(val1) == unicode:
00122           val1 = val1.encode('utf-8')
00123           length = len(val1)
00124         buff.write(struct.pack('<I%ss'%length, length, val1))
00125       length = len(self.confidence)
00126       buff.write(_struct_I.pack(length))
00127       pattern = '<%sf'%length
00128       buff.write(struct.pack(pattern, *self.confidence))
00129       length = len(self.position)
00130       buff.write(_struct_I.pack(length))
00131       for val1 in self.position:
00132         _x = val1
00133         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00134       length = len(self.orientation)
00135       buff.write(_struct_I.pack(length))
00136       for val1 in self.orientation:
00137         _x = val1
00138         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00139     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00140     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00141 
00142   def deserialize(self, str):
00143     """
00144     unpack serialized message in str into this message instance
00145     :param str: byte array of serialized message, ``str``
00146     """
00147     try:
00148       if self.header is None:
00149         self.header = std_msgs.msg.Header()
00150       if self.position is None:
00151         self.position = None
00152       if self.orientation is None:
00153         self.orientation = None
00154       end = 0
00155       _x = self
00156       start = end
00157       end += 12
00158       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00159       start = end
00160       end += 4
00161       (length,) = _struct_I.unpack(str[start:end])
00162       start = end
00163       end += length
00164       if python3:
00165         self.header.frame_id = str[start:end].decode('utf-8')
00166       else:
00167         self.header.frame_id = str[start:end]
00168       start = end
00169       end += 4
00170       (self.user_id,) = _struct_i.unpack(str[start:end])
00171       start = end
00172       end += 4
00173       (length,) = _struct_I.unpack(str[start:end])
00174       self.name = []
00175       for i in range(0, length):
00176         start = end
00177         end += 4
00178         (length,) = _struct_I.unpack(str[start:end])
00179         start = end
00180         end += length
00181         if python3:
00182           val1 = str[start:end].decode('utf-8')
00183         else:
00184           val1 = str[start:end]
00185         self.name.append(val1)
00186       start = end
00187       end += 4
00188       (length,) = _struct_I.unpack(str[start:end])
00189       pattern = '<%sf'%length
00190       start = end
00191       end += struct.calcsize(pattern)
00192       self.confidence = struct.unpack(pattern, str[start:end])
00193       start = end
00194       end += 4
00195       (length,) = _struct_I.unpack(str[start:end])
00196       self.position = []
00197       for i in range(0, length):
00198         val1 = geometry_msgs.msg.Vector3()
00199         _x = val1
00200         start = end
00201         end += 24
00202         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00203         self.position.append(val1)
00204       start = end
00205       end += 4
00206       (length,) = _struct_I.unpack(str[start:end])
00207       self.orientation = []
00208       for i in range(0, length):
00209         val1 = geometry_msgs.msg.Quaternion()
00210         _x = val1
00211         start = end
00212         end += 32
00213         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00214         self.orientation.append(val1)
00215       return self
00216     except struct.error as e:
00217       raise genpy.DeserializationError(e) #most likely buffer underfill
00218 
00219 
00220   def serialize_numpy(self, buff, numpy):
00221     """
00222     serialize message with numpy array types into buffer
00223     :param buff: buffer, ``StringIO``
00224     :param numpy: numpy python module
00225     """
00226     try:
00227       _x = self
00228       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00229       _x = self.header.frame_id
00230       length = len(_x)
00231       if python3 or type(_x) == unicode:
00232         _x = _x.encode('utf-8')
00233         length = len(_x)
00234       buff.write(struct.pack('<I%ss'%length, length, _x))
00235       buff.write(_struct_i.pack(self.user_id))
00236       length = len(self.name)
00237       buff.write(_struct_I.pack(length))
00238       for val1 in self.name:
00239         length = len(val1)
00240         if python3 or type(val1) == unicode:
00241           val1 = val1.encode('utf-8')
00242           length = len(val1)
00243         buff.write(struct.pack('<I%ss'%length, length, val1))
00244       length = len(self.confidence)
00245       buff.write(_struct_I.pack(length))
00246       pattern = '<%sf'%length
00247       buff.write(self.confidence.tostring())
00248       length = len(self.position)
00249       buff.write(_struct_I.pack(length))
00250       for val1 in self.position:
00251         _x = val1
00252         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00253       length = len(self.orientation)
00254       buff.write(_struct_I.pack(length))
00255       for val1 in self.orientation:
00256         _x = val1
00257         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00258     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00259     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00260 
00261   def deserialize_numpy(self, str, numpy):
00262     """
00263     unpack serialized message in str into this message instance using numpy for array types
00264     :param str: byte array of serialized message, ``str``
00265     :param numpy: numpy python module
00266     """
00267     try:
00268       if self.header is None:
00269         self.header = std_msgs.msg.Header()
00270       if self.position is None:
00271         self.position = None
00272       if self.orientation is None:
00273         self.orientation = None
00274       end = 0
00275       _x = self
00276       start = end
00277       end += 12
00278       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00279       start = end
00280       end += 4
00281       (length,) = _struct_I.unpack(str[start:end])
00282       start = end
00283       end += length
00284       if python3:
00285         self.header.frame_id = str[start:end].decode('utf-8')
00286       else:
00287         self.header.frame_id = str[start:end]
00288       start = end
00289       end += 4
00290       (self.user_id,) = _struct_i.unpack(str[start:end])
00291       start = end
00292       end += 4
00293       (length,) = _struct_I.unpack(str[start:end])
00294       self.name = []
00295       for i in range(0, length):
00296         start = end
00297         end += 4
00298         (length,) = _struct_I.unpack(str[start:end])
00299         start = end
00300         end += length
00301         if python3:
00302           val1 = str[start:end].decode('utf-8')
00303         else:
00304           val1 = str[start:end]
00305         self.name.append(val1)
00306       start = end
00307       end += 4
00308       (length,) = _struct_I.unpack(str[start:end])
00309       pattern = '<%sf'%length
00310       start = end
00311       end += struct.calcsize(pattern)
00312       self.confidence = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00313       start = end
00314       end += 4
00315       (length,) = _struct_I.unpack(str[start:end])
00316       self.position = []
00317       for i in range(0, length):
00318         val1 = geometry_msgs.msg.Vector3()
00319         _x = val1
00320         start = end
00321         end += 24
00322         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00323         self.position.append(val1)
00324       start = end
00325       end += 4
00326       (length,) = _struct_I.unpack(str[start:end])
00327       self.orientation = []
00328       for i in range(0, length):
00329         val1 = geometry_msgs.msg.Quaternion()
00330         _x = val1
00331         start = end
00332         end += 32
00333         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00334         self.orientation.append(val1)
00335       return self
00336     except struct.error as e:
00337       raise genpy.DeserializationError(e) #most likely buffer underfill
00338 
00339 _struct_I = genpy.struct_I
00340 _struct_i = struct.Struct("<i")
00341 _struct_3I = struct.Struct("<3I")
00342 _struct_4d = struct.Struct("<4d")
00343 _struct_3d = struct.Struct("<3d")


skeleton_markers
Author(s): Patrick Goebel
autogenerated on Mon Oct 6 2014 07:41:01