_SkinContact.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/SkinContact.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 hrl_msgs.msg
00009 import std_msgs.msg
00010 
00011 class SkinContact(genpy.Message):
00012   _md5sum = "37fe3e288b59bae570bada4c7b9240cf"
00013   _type = "hrl_haptic_manipulation_in_clutter_msgs/SkinContact"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """Header header
00016 geometry_msgs/Point[] locations
00017 geometry_msgs/Vector3[] forces
00018 
00019 # normals to the manipulator surface at the points of contact.
00020 geometry_msgs/Vector3[] normals
00021 
00022 string[] link_names
00023 
00024 #all the points (from collision map) that make up one contact location.
00025 hrl_msgs/FloatArrayBare[] pts_x
00026 hrl_msgs/FloatArrayBare[] pts_y
00027 hrl_msgs/FloatArrayBare[] pts_z
00028 
00029 
00030 
00031 
00032 
00033 ================================================================================
00034 MSG: std_msgs/Header
00035 # Standard metadata for higher-level stamped data types.
00036 # This is generally used to communicate timestamped data 
00037 # in a particular coordinate frame.
00038 # 
00039 # sequence ID: consecutively increasing ID 
00040 uint32 seq
00041 #Two-integer timestamp that is expressed as:
00042 # * stamp.secs: seconds (stamp_secs) since epoch
00043 # * stamp.nsecs: nanoseconds since stamp_secs
00044 # time-handling sugar is provided by the client library
00045 time stamp
00046 #Frame this data is associated with
00047 # 0: no frame
00048 # 1: global frame
00049 string frame_id
00050 
00051 ================================================================================
00052 MSG: geometry_msgs/Point
00053 # This contains the position of a point in free space
00054 float64 x
00055 float64 y
00056 float64 z
00057 
00058 ================================================================================
00059 MSG: geometry_msgs/Vector3
00060 # This represents a vector in free space. 
00061 
00062 float64 x
00063 float64 y
00064 float64 z
00065 ================================================================================
00066 MSG: hrl_msgs/FloatArrayBare
00067 float64[] data
00068 
00069 
00070 """
00071   __slots__ = ['header','locations','forces','normals','link_names','pts_x','pts_y','pts_z']
00072   _slot_types = ['std_msgs/Header','geometry_msgs/Point[]','geometry_msgs/Vector3[]','geometry_msgs/Vector3[]','string[]','hrl_msgs/FloatArrayBare[]','hrl_msgs/FloatArrayBare[]','hrl_msgs/FloatArrayBare[]']
00073 
00074   def __init__(self, *args, **kwds):
00075     """
00076     Constructor. Any message fields that are implicitly/explicitly
00077     set to None will be assigned a default value. The recommend
00078     use is keyword arguments as this is more robust to future message
00079     changes.  You cannot mix in-order arguments and keyword arguments.
00080 
00081     The available fields are:
00082        header,locations,forces,normals,link_names,pts_x,pts_y,pts_z
00083 
00084     :param args: complete set of field values, in .msg order
00085     :param kwds: use keyword arguments corresponding to message field names
00086     to set specific fields.
00087     """
00088     if args or kwds:
00089       super(SkinContact, self).__init__(*args, **kwds)
00090       #message fields cannot be None, assign default values for those that are
00091       if self.header is None:
00092         self.header = std_msgs.msg.Header()
00093       if self.locations is None:
00094         self.locations = []
00095       if self.forces is None:
00096         self.forces = []
00097       if self.normals is None:
00098         self.normals = []
00099       if self.link_names is None:
00100         self.link_names = []
00101       if self.pts_x is None:
00102         self.pts_x = []
00103       if self.pts_y is None:
00104         self.pts_y = []
00105       if self.pts_z is None:
00106         self.pts_z = []
00107     else:
00108       self.header = std_msgs.msg.Header()
00109       self.locations = []
00110       self.forces = []
00111       self.normals = []
00112       self.link_names = []
00113       self.pts_x = []
00114       self.pts_y = []
00115       self.pts_z = []
00116 
00117   def _get_types(self):
00118     """
00119     internal API method
00120     """
00121     return self._slot_types
00122 
00123   def serialize(self, buff):
00124     """
00125     serialize message into buffer
00126     :param buff: buffer, ``StringIO``
00127     """
00128     try:
00129       _x = self
00130       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00131       _x = self.header.frame_id
00132       length = len(_x)
00133       if python3 or type(_x) == unicode:
00134         _x = _x.encode('utf-8')
00135         length = len(_x)
00136       buff.write(struct.pack('<I%ss'%length, length, _x))
00137       length = len(self.locations)
00138       buff.write(_struct_I.pack(length))
00139       for val1 in self.locations:
00140         _x = val1
00141         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00142       length = len(self.forces)
00143       buff.write(_struct_I.pack(length))
00144       for val1 in self.forces:
00145         _x = val1
00146         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00147       length = len(self.normals)
00148       buff.write(_struct_I.pack(length))
00149       for val1 in self.normals:
00150         _x = val1
00151         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00152       length = len(self.link_names)
00153       buff.write(_struct_I.pack(length))
00154       for val1 in self.link_names:
00155         length = len(val1)
00156         if python3 or type(val1) == unicode:
00157           val1 = val1.encode('utf-8')
00158           length = len(val1)
00159         buff.write(struct.pack('<I%ss'%length, length, val1))
00160       length = len(self.pts_x)
00161       buff.write(_struct_I.pack(length))
00162       for val1 in self.pts_x:
00163         length = len(val1.data)
00164         buff.write(_struct_I.pack(length))
00165         pattern = '<%sd'%length
00166         buff.write(struct.pack(pattern, *val1.data))
00167       length = len(self.pts_y)
00168       buff.write(_struct_I.pack(length))
00169       for val1 in self.pts_y:
00170         length = len(val1.data)
00171         buff.write(_struct_I.pack(length))
00172         pattern = '<%sd'%length
00173         buff.write(struct.pack(pattern, *val1.data))
00174       length = len(self.pts_z)
00175       buff.write(_struct_I.pack(length))
00176       for val1 in self.pts_z:
00177         length = len(val1.data)
00178         buff.write(_struct_I.pack(length))
00179         pattern = '<%sd'%length
00180         buff.write(struct.pack(pattern, *val1.data))
00181     except struct.error as se: self._check_types(se)
00182     except TypeError as te: self._check_types(te)
00183 
00184   def deserialize(self, str):
00185     """
00186     unpack serialized message in str into this message instance
00187     :param str: byte array of serialized message, ``str``
00188     """
00189     try:
00190       if self.header is None:
00191         self.header = std_msgs.msg.Header()
00192       if self.locations is None:
00193         self.locations = None
00194       if self.forces is None:
00195         self.forces = None
00196       if self.normals is None:
00197         self.normals = None
00198       if self.pts_x is None:
00199         self.pts_x = None
00200       if self.pts_y is None:
00201         self.pts_y = None
00202       if self.pts_z is None:
00203         self.pts_z = None
00204       end = 0
00205       _x = self
00206       start = end
00207       end += 12
00208       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00209       start = end
00210       end += 4
00211       (length,) = _struct_I.unpack(str[start:end])
00212       start = end
00213       end += length
00214       if python3:
00215         self.header.frame_id = str[start:end].decode('utf-8')
00216       else:
00217         self.header.frame_id = str[start:end]
00218       start = end
00219       end += 4
00220       (length,) = _struct_I.unpack(str[start:end])
00221       self.locations = []
00222       for i in range(0, length):
00223         val1 = geometry_msgs.msg.Point()
00224         _x = val1
00225         start = end
00226         end += 24
00227         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00228         self.locations.append(val1)
00229       start = end
00230       end += 4
00231       (length,) = _struct_I.unpack(str[start:end])
00232       self.forces = []
00233       for i in range(0, length):
00234         val1 = geometry_msgs.msg.Vector3()
00235         _x = val1
00236         start = end
00237         end += 24
00238         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00239         self.forces.append(val1)
00240       start = end
00241       end += 4
00242       (length,) = _struct_I.unpack(str[start:end])
00243       self.normals = []
00244       for i in range(0, length):
00245         val1 = geometry_msgs.msg.Vector3()
00246         _x = val1
00247         start = end
00248         end += 24
00249         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00250         self.normals.append(val1)
00251       start = end
00252       end += 4
00253       (length,) = _struct_I.unpack(str[start:end])
00254       self.link_names = []
00255       for i in range(0, length):
00256         start = end
00257         end += 4
00258         (length,) = _struct_I.unpack(str[start:end])
00259         start = end
00260         end += length
00261         if python3:
00262           val1 = str[start:end].decode('utf-8')
00263         else:
00264           val1 = str[start:end]
00265         self.link_names.append(val1)
00266       start = end
00267       end += 4
00268       (length,) = _struct_I.unpack(str[start:end])
00269       self.pts_x = []
00270       for i in range(0, length):
00271         val1 = hrl_msgs.msg.FloatArrayBare()
00272         start = end
00273         end += 4
00274         (length,) = _struct_I.unpack(str[start:end])
00275         pattern = '<%sd'%length
00276         start = end
00277         end += struct.calcsize(pattern)
00278         val1.data = struct.unpack(pattern, str[start:end])
00279         self.pts_x.append(val1)
00280       start = end
00281       end += 4
00282       (length,) = _struct_I.unpack(str[start:end])
00283       self.pts_y = []
00284       for i in range(0, length):
00285         val1 = hrl_msgs.msg.FloatArrayBare()
00286         start = end
00287         end += 4
00288         (length,) = _struct_I.unpack(str[start:end])
00289         pattern = '<%sd'%length
00290         start = end
00291         end += struct.calcsize(pattern)
00292         val1.data = struct.unpack(pattern, str[start:end])
00293         self.pts_y.append(val1)
00294       start = end
00295       end += 4
00296       (length,) = _struct_I.unpack(str[start:end])
00297       self.pts_z = []
00298       for i in range(0, length):
00299         val1 = hrl_msgs.msg.FloatArrayBare()
00300         start = end
00301         end += 4
00302         (length,) = _struct_I.unpack(str[start:end])
00303         pattern = '<%sd'%length
00304         start = end
00305         end += struct.calcsize(pattern)
00306         val1.data = struct.unpack(pattern, str[start:end])
00307         self.pts_z.append(val1)
00308       return self
00309     except struct.error as e:
00310       raise genpy.DeserializationError(e) #most likely buffer underfill
00311 
00312 
00313   def serialize_numpy(self, buff, numpy):
00314     """
00315     serialize message with numpy array types into buffer
00316     :param buff: buffer, ``StringIO``
00317     :param numpy: numpy python module
00318     """
00319     try:
00320       _x = self
00321       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00322       _x = self.header.frame_id
00323       length = len(_x)
00324       if python3 or type(_x) == unicode:
00325         _x = _x.encode('utf-8')
00326         length = len(_x)
00327       buff.write(struct.pack('<I%ss'%length, length, _x))
00328       length = len(self.locations)
00329       buff.write(_struct_I.pack(length))
00330       for val1 in self.locations:
00331         _x = val1
00332         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00333       length = len(self.forces)
00334       buff.write(_struct_I.pack(length))
00335       for val1 in self.forces:
00336         _x = val1
00337         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00338       length = len(self.normals)
00339       buff.write(_struct_I.pack(length))
00340       for val1 in self.normals:
00341         _x = val1
00342         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00343       length = len(self.link_names)
00344       buff.write(_struct_I.pack(length))
00345       for val1 in self.link_names:
00346         length = len(val1)
00347         if python3 or type(val1) == unicode:
00348           val1 = val1.encode('utf-8')
00349           length = len(val1)
00350         buff.write(struct.pack('<I%ss'%length, length, val1))
00351       length = len(self.pts_x)
00352       buff.write(_struct_I.pack(length))
00353       for val1 in self.pts_x:
00354         length = len(val1.data)
00355         buff.write(_struct_I.pack(length))
00356         pattern = '<%sd'%length
00357         buff.write(val1.data.tostring())
00358       length = len(self.pts_y)
00359       buff.write(_struct_I.pack(length))
00360       for val1 in self.pts_y:
00361         length = len(val1.data)
00362         buff.write(_struct_I.pack(length))
00363         pattern = '<%sd'%length
00364         buff.write(val1.data.tostring())
00365       length = len(self.pts_z)
00366       buff.write(_struct_I.pack(length))
00367       for val1 in self.pts_z:
00368         length = len(val1.data)
00369         buff.write(_struct_I.pack(length))
00370         pattern = '<%sd'%length
00371         buff.write(val1.data.tostring())
00372     except struct.error as se: self._check_types(se)
00373     except TypeError as te: self._check_types(te)
00374 
00375   def deserialize_numpy(self, str, numpy):
00376     """
00377     unpack serialized message in str into this message instance using numpy for array types
00378     :param str: byte array of serialized message, ``str``
00379     :param numpy: numpy python module
00380     """
00381     try:
00382       if self.header is None:
00383         self.header = std_msgs.msg.Header()
00384       if self.locations is None:
00385         self.locations = None
00386       if self.forces is None:
00387         self.forces = None
00388       if self.normals is None:
00389         self.normals = None
00390       if self.pts_x is None:
00391         self.pts_x = None
00392       if self.pts_y is None:
00393         self.pts_y = None
00394       if self.pts_z is None:
00395         self.pts_z = None
00396       end = 0
00397       _x = self
00398       start = end
00399       end += 12
00400       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00401       start = end
00402       end += 4
00403       (length,) = _struct_I.unpack(str[start:end])
00404       start = end
00405       end += length
00406       if python3:
00407         self.header.frame_id = str[start:end].decode('utf-8')
00408       else:
00409         self.header.frame_id = str[start:end]
00410       start = end
00411       end += 4
00412       (length,) = _struct_I.unpack(str[start:end])
00413       self.locations = []
00414       for i in range(0, length):
00415         val1 = geometry_msgs.msg.Point()
00416         _x = val1
00417         start = end
00418         end += 24
00419         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00420         self.locations.append(val1)
00421       start = end
00422       end += 4
00423       (length,) = _struct_I.unpack(str[start:end])
00424       self.forces = []
00425       for i in range(0, length):
00426         val1 = geometry_msgs.msg.Vector3()
00427         _x = val1
00428         start = end
00429         end += 24
00430         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00431         self.forces.append(val1)
00432       start = end
00433       end += 4
00434       (length,) = _struct_I.unpack(str[start:end])
00435       self.normals = []
00436       for i in range(0, length):
00437         val1 = geometry_msgs.msg.Vector3()
00438         _x = val1
00439         start = end
00440         end += 24
00441         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00442         self.normals.append(val1)
00443       start = end
00444       end += 4
00445       (length,) = _struct_I.unpack(str[start:end])
00446       self.link_names = []
00447       for i in range(0, length):
00448         start = end
00449         end += 4
00450         (length,) = _struct_I.unpack(str[start:end])
00451         start = end
00452         end += length
00453         if python3:
00454           val1 = str[start:end].decode('utf-8')
00455         else:
00456           val1 = str[start:end]
00457         self.link_names.append(val1)
00458       start = end
00459       end += 4
00460       (length,) = _struct_I.unpack(str[start:end])
00461       self.pts_x = []
00462       for i in range(0, length):
00463         val1 = hrl_msgs.msg.FloatArrayBare()
00464         start = end
00465         end += 4
00466         (length,) = _struct_I.unpack(str[start:end])
00467         pattern = '<%sd'%length
00468         start = end
00469         end += struct.calcsize(pattern)
00470         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00471         self.pts_x.append(val1)
00472       start = end
00473       end += 4
00474       (length,) = _struct_I.unpack(str[start:end])
00475       self.pts_y = []
00476       for i in range(0, length):
00477         val1 = hrl_msgs.msg.FloatArrayBare()
00478         start = end
00479         end += 4
00480         (length,) = _struct_I.unpack(str[start:end])
00481         pattern = '<%sd'%length
00482         start = end
00483         end += struct.calcsize(pattern)
00484         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00485         self.pts_y.append(val1)
00486       start = end
00487       end += 4
00488       (length,) = _struct_I.unpack(str[start:end])
00489       self.pts_z = []
00490       for i in range(0, length):
00491         val1 = hrl_msgs.msg.FloatArrayBare()
00492         start = end
00493         end += 4
00494         (length,) = _struct_I.unpack(str[start:end])
00495         pattern = '<%sd'%length
00496         start = end
00497         end += struct.calcsize(pattern)
00498         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00499         self.pts_z.append(val1)
00500       return self
00501     except struct.error as e:
00502       raise genpy.DeserializationError(e) #most likely buffer underfill
00503 
00504 _struct_I = genpy.struct_I
00505 _struct_3I = struct.Struct("<3I")
00506 _struct_3d = struct.Struct("<3d")


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