_env_checkcollision.py
Go to the documentation of this file.
00001 """autogenerated by genpy from openraveros/env_checkcollisionRequest.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 env_checkcollisionRequest(genpy.Message):
00009   _md5sum = "0522d5e0914fec17872837ada6628b4e"
00010   _type = "openraveros/env_checkcollisionRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 int32 bodyid
00014 
00015 
00016 int8 linkid
00017 
00018 int32[] excludedbodyids
00019 
00020 
00021 float32 tolerance
00022 
00023 
00024 uint8 checkselfcollision
00025 
00026 
00027 uint8 options
00028 
00029 uint8 CO_Distance=1
00030 uint8 CO_UseTolerance=2
00031 uint8 CO_Contacts=4
00032 uint8 CO_RayAnyHit=8
00033 
00034 
00035 """
00036   # Pseudo-constants
00037   CO_Distance = 1
00038   CO_UseTolerance = 2
00039   CO_Contacts = 4
00040   CO_RayAnyHit = 8
00041 
00042   __slots__ = ['bodyid','linkid','excludedbodyids','tolerance','checkselfcollision','options']
00043   _slot_types = ['int32','int8','int32[]','float32','uint8','uint8']
00044 
00045   def __init__(self, *args, **kwds):
00046     """
00047     Constructor. Any message fields that are implicitly/explicitly
00048     set to None will be assigned a default value. The recommend
00049     use is keyword arguments as this is more robust to future message
00050     changes.  You cannot mix in-order arguments and keyword arguments.
00051 
00052     The available fields are:
00053        bodyid,linkid,excludedbodyids,tolerance,checkselfcollision,options
00054 
00055     :param args: complete set of field values, in .msg order
00056     :param kwds: use keyword arguments corresponding to message field names
00057     to set specific fields.
00058     """
00059     if args or kwds:
00060       super(env_checkcollisionRequest, self).__init__(*args, **kwds)
00061       #message fields cannot be None, assign default values for those that are
00062       if self.bodyid is None:
00063         self.bodyid = 0
00064       if self.linkid is None:
00065         self.linkid = 0
00066       if self.excludedbodyids is None:
00067         self.excludedbodyids = []
00068       if self.tolerance is None:
00069         self.tolerance = 0.
00070       if self.checkselfcollision is None:
00071         self.checkselfcollision = 0
00072       if self.options is None:
00073         self.options = 0
00074     else:
00075       self.bodyid = 0
00076       self.linkid = 0
00077       self.excludedbodyids = []
00078       self.tolerance = 0.
00079       self.checkselfcollision = 0
00080       self.options = 0
00081 
00082   def _get_types(self):
00083     """
00084     internal API method
00085     """
00086     return self._slot_types
00087 
00088   def serialize(self, buff):
00089     """
00090     serialize message into buffer
00091     :param buff: buffer, ``StringIO``
00092     """
00093     try:
00094       _x = self
00095       buff.write(_struct_ib.pack(_x.bodyid, _x.linkid))
00096       length = len(self.excludedbodyids)
00097       buff.write(_struct_I.pack(length))
00098       pattern = '<%si'%length
00099       buff.write(struct.pack(pattern, *self.excludedbodyids))
00100       _x = self
00101       buff.write(_struct_f2B.pack(_x.tolerance, _x.checkselfcollision, _x.options))
00102     except struct.error as se: self._check_types(se)
00103     except TypeError as te: self._check_types(te)
00104 
00105   def deserialize(self, str):
00106     """
00107     unpack serialized message in str into this message instance
00108     :param str: byte array of serialized message, ``str``
00109     """
00110     try:
00111       end = 0
00112       _x = self
00113       start = end
00114       end += 5
00115       (_x.bodyid, _x.linkid,) = _struct_ib.unpack(str[start:end])
00116       start = end
00117       end += 4
00118       (length,) = _struct_I.unpack(str[start:end])
00119       pattern = '<%si'%length
00120       start = end
00121       end += struct.calcsize(pattern)
00122       self.excludedbodyids = struct.unpack(pattern, str[start:end])
00123       _x = self
00124       start = end
00125       end += 6
00126       (_x.tolerance, _x.checkselfcollision, _x.options,) = _struct_f2B.unpack(str[start:end])
00127       return self
00128     except struct.error as e:
00129       raise genpy.DeserializationError(e) #most likely buffer underfill
00130 
00131 
00132   def serialize_numpy(self, buff, numpy):
00133     """
00134     serialize message with numpy array types into buffer
00135     :param buff: buffer, ``StringIO``
00136     :param numpy: numpy python module
00137     """
00138     try:
00139       _x = self
00140       buff.write(_struct_ib.pack(_x.bodyid, _x.linkid))
00141       length = len(self.excludedbodyids)
00142       buff.write(_struct_I.pack(length))
00143       pattern = '<%si'%length
00144       buff.write(self.excludedbodyids.tostring())
00145       _x = self
00146       buff.write(_struct_f2B.pack(_x.tolerance, _x.checkselfcollision, _x.options))
00147     except struct.error as se: self._check_types(se)
00148     except TypeError as te: self._check_types(te)
00149 
00150   def deserialize_numpy(self, str, numpy):
00151     """
00152     unpack serialized message in str into this message instance using numpy for array types
00153     :param str: byte array of serialized message, ``str``
00154     :param numpy: numpy python module
00155     """
00156     try:
00157       end = 0
00158       _x = self
00159       start = end
00160       end += 5
00161       (_x.bodyid, _x.linkid,) = _struct_ib.unpack(str[start:end])
00162       start = end
00163       end += 4
00164       (length,) = _struct_I.unpack(str[start:end])
00165       pattern = '<%si'%length
00166       start = end
00167       end += struct.calcsize(pattern)
00168       self.excludedbodyids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00169       _x = self
00170       start = end
00171       end += 6
00172       (_x.tolerance, _x.checkselfcollision, _x.options,) = _struct_f2B.unpack(str[start:end])
00173       return self
00174     except struct.error as e:
00175       raise genpy.DeserializationError(e) #most likely buffer underfill
00176 
00177 _struct_I = genpy.struct_I
00178 _struct_f2B = struct.Struct("<f2B")
00179 _struct_ib = struct.Struct("<ib")
00180 """autogenerated by genpy from openraveros/env_checkcollisionResponse.msg. Do not edit."""
00181 import sys
00182 python3 = True if sys.hexversion > 0x03000000 else False
00183 import genpy
00184 import struct
00185 
00186 import openraveros.msg
00187 
00188 class env_checkcollisionResponse(genpy.Message):
00189   _md5sum = "b7594e25483e9adcacf4c2ea17ad87f4"
00190   _type = "openraveros/env_checkcollisionResponse"
00191   _has_header = False #flag to mark the presence of a Header object
00192   _full_text = """uint8 collision
00193 int32 collidingbodyid
00194 
00195 
00196 uint8 collidinglink
00197 
00198 
00199 Contact[] contacts
00200 
00201 
00202 float32 mindist
00203 
00204 
00205 ================================================================================
00206 MSG: openraveros/Contact
00207 float32[3] position
00208 float32[3] normal
00209 
00210 """
00211   __slots__ = ['collision','collidingbodyid','collidinglink','contacts','mindist']
00212   _slot_types = ['uint8','int32','uint8','openraveros/Contact[]','float32']
00213 
00214   def __init__(self, *args, **kwds):
00215     """
00216     Constructor. Any message fields that are implicitly/explicitly
00217     set to None will be assigned a default value. The recommend
00218     use is keyword arguments as this is more robust to future message
00219     changes.  You cannot mix in-order arguments and keyword arguments.
00220 
00221     The available fields are:
00222        collision,collidingbodyid,collidinglink,contacts,mindist
00223 
00224     :param args: complete set of field values, in .msg order
00225     :param kwds: use keyword arguments corresponding to message field names
00226     to set specific fields.
00227     """
00228     if args or kwds:
00229       super(env_checkcollisionResponse, self).__init__(*args, **kwds)
00230       #message fields cannot be None, assign default values for those that are
00231       if self.collision is None:
00232         self.collision = 0
00233       if self.collidingbodyid is None:
00234         self.collidingbodyid = 0
00235       if self.collidinglink is None:
00236         self.collidinglink = 0
00237       if self.contacts is None:
00238         self.contacts = []
00239       if self.mindist is None:
00240         self.mindist = 0.
00241     else:
00242       self.collision = 0
00243       self.collidingbodyid = 0
00244       self.collidinglink = 0
00245       self.contacts = []
00246       self.mindist = 0.
00247 
00248   def _get_types(self):
00249     """
00250     internal API method
00251     """
00252     return self._slot_types
00253 
00254   def serialize(self, buff):
00255     """
00256     serialize message into buffer
00257     :param buff: buffer, ``StringIO``
00258     """
00259     try:
00260       _x = self
00261       buff.write(_struct_BiB.pack(_x.collision, _x.collidingbodyid, _x.collidinglink))
00262       length = len(self.contacts)
00263       buff.write(_struct_I.pack(length))
00264       for val1 in self.contacts:
00265         buff.write(_struct_3f.pack(*val1.position))
00266         buff.write(_struct_3f.pack(*val1.normal))
00267       buff.write(_struct_f.pack(self.mindist))
00268     except struct.error as se: self._check_types(se)
00269     except TypeError as te: self._check_types(te)
00270 
00271   def deserialize(self, str):
00272     """
00273     unpack serialized message in str into this message instance
00274     :param str: byte array of serialized message, ``str``
00275     """
00276     try:
00277       if self.contacts is None:
00278         self.contacts = None
00279       end = 0
00280       _x = self
00281       start = end
00282       end += 6
00283       (_x.collision, _x.collidingbodyid, _x.collidinglink,) = _struct_BiB.unpack(str[start:end])
00284       start = end
00285       end += 4
00286       (length,) = _struct_I.unpack(str[start:end])
00287       self.contacts = []
00288       for i in range(0, length):
00289         val1 = openraveros.msg.Contact()
00290         start = end
00291         end += 12
00292         val1.position = _struct_3f.unpack(str[start:end])
00293         start = end
00294         end += 12
00295         val1.normal = _struct_3f.unpack(str[start:end])
00296         self.contacts.append(val1)
00297       start = end
00298       end += 4
00299       (self.mindist,) = _struct_f.unpack(str[start:end])
00300       return self
00301     except struct.error as e:
00302       raise genpy.DeserializationError(e) #most likely buffer underfill
00303 
00304 
00305   def serialize_numpy(self, buff, numpy):
00306     """
00307     serialize message with numpy array types into buffer
00308     :param buff: buffer, ``StringIO``
00309     :param numpy: numpy python module
00310     """
00311     try:
00312       _x = self
00313       buff.write(_struct_BiB.pack(_x.collision, _x.collidingbodyid, _x.collidinglink))
00314       length = len(self.contacts)
00315       buff.write(_struct_I.pack(length))
00316       for val1 in self.contacts:
00317         buff.write(val1.position.tostring())
00318         buff.write(val1.normal.tostring())
00319       buff.write(_struct_f.pack(self.mindist))
00320     except struct.error as se: self._check_types(se)
00321     except TypeError as te: self._check_types(te)
00322 
00323   def deserialize_numpy(self, str, numpy):
00324     """
00325     unpack serialized message in str into this message instance using numpy for array types
00326     :param str: byte array of serialized message, ``str``
00327     :param numpy: numpy python module
00328     """
00329     try:
00330       if self.contacts is None:
00331         self.contacts = None
00332       end = 0
00333       _x = self
00334       start = end
00335       end += 6
00336       (_x.collision, _x.collidingbodyid, _x.collidinglink,) = _struct_BiB.unpack(str[start:end])
00337       start = end
00338       end += 4
00339       (length,) = _struct_I.unpack(str[start:end])
00340       self.contacts = []
00341       for i in range(0, length):
00342         val1 = openraveros.msg.Contact()
00343         start = end
00344         end += 12
00345         val1.position = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
00346         start = end
00347         end += 12
00348         val1.normal = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
00349         self.contacts.append(val1)
00350       start = end
00351       end += 4
00352       (self.mindist,) = _struct_f.unpack(str[start:end])
00353       return self
00354     except struct.error as e:
00355       raise genpy.DeserializationError(e) #most likely buffer underfill
00356 
00357 _struct_I = genpy.struct_I
00358 _struct_BiB = struct.Struct("<BiB")
00359 _struct_3f = struct.Struct("<3f")
00360 _struct_f = struct.Struct("<f")
00361 class env_checkcollision(object):
00362   _type          = 'openraveros/env_checkcollision'
00363   _md5sum = 'c31338a70538724710a041530ce615b4'
00364   _request_class  = env_checkcollisionRequest
00365   _response_class = env_checkcollisionResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


openraveros
Author(s): Rosen Diankov (rosen.diankov@gmail.com)
autogenerated on Sat Mar 23 2013 22:15:38