00001 """autogenerated by genpy from arm_navigation_msgs/ContactInformation.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 ContactInformation(genpy.Message):
00011 _md5sum = "85f341c0166ad4e68b4421391bbd2e15"
00012 _type = "arm_navigation_msgs/ContactInformation"
00013 _has_header = True
00014 _full_text = """# Standard ROS header contains information
00015 # about the frame in which this
00016 # contact is specified
00017 Header header
00018
00019 # Position of the contact point
00020 geometry_msgs/Point position
00021
00022 # Normal corresponding to the contact point
00023 geometry_msgs/Vector3 normal
00024
00025 # Depth of contact point
00026 float64 depth
00027
00028 # Name of the first body that is in contact
00029 # This could be a link or a namespace that represents a body
00030 string contact_body_1
00031 string attached_body_1
00032 uint32 body_type_1
00033
00034 # Name of the second body that is in contact
00035 # This could be a link or a namespace that represents a body
00036 string contact_body_2
00037 string attached_body_2
00038 uint32 body_type_2
00039
00040 uint32 ROBOT_LINK=0
00041 uint32 OBJECT=1
00042 uint32 ATTACHED_BODY=2
00043 ================================================================================
00044 MSG: std_msgs/Header
00045 # Standard metadata for higher-level stamped data types.
00046 # This is generally used to communicate timestamped data
00047 # in a particular coordinate frame.
00048 #
00049 # sequence ID: consecutively increasing ID
00050 uint32 seq
00051 #Two-integer timestamp that is expressed as:
00052 # * stamp.secs: seconds (stamp_secs) since epoch
00053 # * stamp.nsecs: nanoseconds since stamp_secs
00054 # time-handling sugar is provided by the client library
00055 time stamp
00056 #Frame this data is associated with
00057 # 0: no frame
00058 # 1: global frame
00059 string frame_id
00060
00061 ================================================================================
00062 MSG: geometry_msgs/Point
00063 # This contains the position of a point in free space
00064 float64 x
00065 float64 y
00066 float64 z
00067
00068 ================================================================================
00069 MSG: geometry_msgs/Vector3
00070 # This represents a vector in free space.
00071
00072 float64 x
00073 float64 y
00074 float64 z
00075 """
00076
00077 ROBOT_LINK = 0
00078 OBJECT = 1
00079 ATTACHED_BODY = 2
00080
00081 __slots__ = ['header','position','normal','depth','contact_body_1','attached_body_1','body_type_1','contact_body_2','attached_body_2','body_type_2']
00082 _slot_types = ['std_msgs/Header','geometry_msgs/Point','geometry_msgs/Vector3','float64','string','string','uint32','string','string','uint32']
00083
00084 def __init__(self, *args, **kwds):
00085 """
00086 Constructor. Any message fields that are implicitly/explicitly
00087 set to None will be assigned a default value. The recommend
00088 use is keyword arguments as this is more robust to future message
00089 changes. You cannot mix in-order arguments and keyword arguments.
00090
00091 The available fields are:
00092 header,position,normal,depth,contact_body_1,attached_body_1,body_type_1,contact_body_2,attached_body_2,body_type_2
00093
00094 :param args: complete set of field values, in .msg order
00095 :param kwds: use keyword arguments corresponding to message field names
00096 to set specific fields.
00097 """
00098 if args or kwds:
00099 super(ContactInformation, self).__init__(*args, **kwds)
00100
00101 if self.header is None:
00102 self.header = std_msgs.msg.Header()
00103 if self.position is None:
00104 self.position = geometry_msgs.msg.Point()
00105 if self.normal is None:
00106 self.normal = geometry_msgs.msg.Vector3()
00107 if self.depth is None:
00108 self.depth = 0.
00109 if self.contact_body_1 is None:
00110 self.contact_body_1 = ''
00111 if self.attached_body_1 is None:
00112 self.attached_body_1 = ''
00113 if self.body_type_1 is None:
00114 self.body_type_1 = 0
00115 if self.contact_body_2 is None:
00116 self.contact_body_2 = ''
00117 if self.attached_body_2 is None:
00118 self.attached_body_2 = ''
00119 if self.body_type_2 is None:
00120 self.body_type_2 = 0
00121 else:
00122 self.header = std_msgs.msg.Header()
00123 self.position = geometry_msgs.msg.Point()
00124 self.normal = geometry_msgs.msg.Vector3()
00125 self.depth = 0.
00126 self.contact_body_1 = ''
00127 self.attached_body_1 = ''
00128 self.body_type_1 = 0
00129 self.contact_body_2 = ''
00130 self.attached_body_2 = ''
00131 self.body_type_2 = 0
00132
00133 def _get_types(self):
00134 """
00135 internal API method
00136 """
00137 return self._slot_types
00138
00139 def serialize(self, buff):
00140 """
00141 serialize message into buffer
00142 :param buff: buffer, ``StringIO``
00143 """
00144 try:
00145 _x = self
00146 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00147 _x = self.header.frame_id
00148 length = len(_x)
00149 if python3 or type(_x) == unicode:
00150 _x = _x.encode('utf-8')
00151 length = len(_x)
00152 buff.write(struct.pack('<I%ss'%length, length, _x))
00153 _x = self
00154 buff.write(_struct_7d.pack(_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth))
00155 _x = self.contact_body_1
00156 length = len(_x)
00157 if python3 or type(_x) == unicode:
00158 _x = _x.encode('utf-8')
00159 length = len(_x)
00160 buff.write(struct.pack('<I%ss'%length, length, _x))
00161 _x = self.attached_body_1
00162 length = len(_x)
00163 if python3 or type(_x) == unicode:
00164 _x = _x.encode('utf-8')
00165 length = len(_x)
00166 buff.write(struct.pack('<I%ss'%length, length, _x))
00167 buff.write(_struct_I.pack(self.body_type_1))
00168 _x = self.contact_body_2
00169 length = len(_x)
00170 if python3 or type(_x) == unicode:
00171 _x = _x.encode('utf-8')
00172 length = len(_x)
00173 buff.write(struct.pack('<I%ss'%length, length, _x))
00174 _x = self.attached_body_2
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 buff.write(_struct_I.pack(self.body_type_2))
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.position is None:
00193 self.position = geometry_msgs.msg.Point()
00194 if self.normal is None:
00195 self.normal = geometry_msgs.msg.Vector3()
00196 end = 0
00197 _x = self
00198 start = end
00199 end += 12
00200 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 if python3:
00207 self.header.frame_id = str[start:end].decode('utf-8')
00208 else:
00209 self.header.frame_id = str[start:end]
00210 _x = self
00211 start = end
00212 end += 56
00213 (_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth,) = _struct_7d.unpack(str[start:end])
00214 start = end
00215 end += 4
00216 (length,) = _struct_I.unpack(str[start:end])
00217 start = end
00218 end += length
00219 if python3:
00220 self.contact_body_1 = str[start:end].decode('utf-8')
00221 else:
00222 self.contact_body_1 = str[start:end]
00223 start = end
00224 end += 4
00225 (length,) = _struct_I.unpack(str[start:end])
00226 start = end
00227 end += length
00228 if python3:
00229 self.attached_body_1 = str[start:end].decode('utf-8')
00230 else:
00231 self.attached_body_1 = str[start:end]
00232 start = end
00233 end += 4
00234 (self.body_type_1,) = _struct_I.unpack(str[start:end])
00235 start = end
00236 end += 4
00237 (length,) = _struct_I.unpack(str[start:end])
00238 start = end
00239 end += length
00240 if python3:
00241 self.contact_body_2 = str[start:end].decode('utf-8')
00242 else:
00243 self.contact_body_2 = str[start:end]
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 start = end
00248 end += length
00249 if python3:
00250 self.attached_body_2 = str[start:end].decode('utf-8')
00251 else:
00252 self.attached_body_2 = str[start:end]
00253 start = end
00254 end += 4
00255 (self.body_type_2,) = _struct_I.unpack(str[start:end])
00256 return self
00257 except struct.error as e:
00258 raise genpy.DeserializationError(e)
00259
00260
00261 def serialize_numpy(self, buff, numpy):
00262 """
00263 serialize message with numpy array types into buffer
00264 :param buff: buffer, ``StringIO``
00265 :param numpy: numpy python module
00266 """
00267 try:
00268 _x = self
00269 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00270 _x = self.header.frame_id
00271 length = len(_x)
00272 if python3 or type(_x) == unicode:
00273 _x = _x.encode('utf-8')
00274 length = len(_x)
00275 buff.write(struct.pack('<I%ss'%length, length, _x))
00276 _x = self
00277 buff.write(_struct_7d.pack(_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth))
00278 _x = self.contact_body_1
00279 length = len(_x)
00280 if python3 or type(_x) == unicode:
00281 _x = _x.encode('utf-8')
00282 length = len(_x)
00283 buff.write(struct.pack('<I%ss'%length, length, _x))
00284 _x = self.attached_body_1
00285 length = len(_x)
00286 if python3 or type(_x) == unicode:
00287 _x = _x.encode('utf-8')
00288 length = len(_x)
00289 buff.write(struct.pack('<I%ss'%length, length, _x))
00290 buff.write(_struct_I.pack(self.body_type_1))
00291 _x = self.contact_body_2
00292 length = len(_x)
00293 if python3 or type(_x) == unicode:
00294 _x = _x.encode('utf-8')
00295 length = len(_x)
00296 buff.write(struct.pack('<I%ss'%length, length, _x))
00297 _x = self.attached_body_2
00298 length = len(_x)
00299 if python3 or type(_x) == unicode:
00300 _x = _x.encode('utf-8')
00301 length = len(_x)
00302 buff.write(struct.pack('<I%ss'%length, length, _x))
00303 buff.write(_struct_I.pack(self.body_type_2))
00304 except struct.error as se: self._check_types(se)
00305 except TypeError as te: self._check_types(te)
00306
00307 def deserialize_numpy(self, str, numpy):
00308 """
00309 unpack serialized message in str into this message instance using numpy for array types
00310 :param str: byte array of serialized message, ``str``
00311 :param numpy: numpy python module
00312 """
00313 try:
00314 if self.header is None:
00315 self.header = std_msgs.msg.Header()
00316 if self.position is None:
00317 self.position = geometry_msgs.msg.Point()
00318 if self.normal is None:
00319 self.normal = geometry_msgs.msg.Vector3()
00320 end = 0
00321 _x = self
00322 start = end
00323 end += 12
00324 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00325 start = end
00326 end += 4
00327 (length,) = _struct_I.unpack(str[start:end])
00328 start = end
00329 end += length
00330 if python3:
00331 self.header.frame_id = str[start:end].decode('utf-8')
00332 else:
00333 self.header.frame_id = str[start:end]
00334 _x = self
00335 start = end
00336 end += 56
00337 (_x.position.x, _x.position.y, _x.position.z, _x.normal.x, _x.normal.y, _x.normal.z, _x.depth,) = _struct_7d.unpack(str[start:end])
00338 start = end
00339 end += 4
00340 (length,) = _struct_I.unpack(str[start:end])
00341 start = end
00342 end += length
00343 if python3:
00344 self.contact_body_1 = str[start:end].decode('utf-8')
00345 else:
00346 self.contact_body_1 = str[start:end]
00347 start = end
00348 end += 4
00349 (length,) = _struct_I.unpack(str[start:end])
00350 start = end
00351 end += length
00352 if python3:
00353 self.attached_body_1 = str[start:end].decode('utf-8')
00354 else:
00355 self.attached_body_1 = str[start:end]
00356 start = end
00357 end += 4
00358 (self.body_type_1,) = _struct_I.unpack(str[start:end])
00359 start = end
00360 end += 4
00361 (length,) = _struct_I.unpack(str[start:end])
00362 start = end
00363 end += length
00364 if python3:
00365 self.contact_body_2 = str[start:end].decode('utf-8')
00366 else:
00367 self.contact_body_2 = str[start:end]
00368 start = end
00369 end += 4
00370 (length,) = _struct_I.unpack(str[start:end])
00371 start = end
00372 end += length
00373 if python3:
00374 self.attached_body_2 = str[start:end].decode('utf-8')
00375 else:
00376 self.attached_body_2 = str[start:end]
00377 start = end
00378 end += 4
00379 (self.body_type_2,) = _struct_I.unpack(str[start:end])
00380 return self
00381 except struct.error as e:
00382 raise genpy.DeserializationError(e)
00383
00384 _struct_I = genpy.struct_I
00385 _struct_3I = struct.Struct("<3I")
00386 _struct_7d = struct.Struct("<7d")