_CollisionOperation.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arm_navigation_msgs/CollisionOperation.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 CollisionOperation(genpy.Message):
00009   _md5sum = "e0cf3073b26bd86266c918a0c779f8a2"
00010   _type = "arm_navigation_msgs/CollisionOperation"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# A definition of a collision operation
00013 # E.g. ("gripper",COLLISION_SET_ALL,ENABLE) will enable collisions 
00014 # between the gripper and all objects in the collision space
00015 
00016 string object1
00017 string object2
00018 string COLLISION_SET_ALL="all"
00019 string COLLISION_SET_OBJECTS="objects"
00020 string COLLISION_SET_ATTACHED_OBJECTS="attached"
00021 
00022 # The penetration distance to which collisions are allowed. This is 0.0 by default.
00023 float64 penetration_distance
00024 
00025 # Flag that determines whether collisions will be enabled or disabled for the pair of objects specified above
00026 int32 operation
00027 int32 DISABLE=0
00028 int32 ENABLE=1
00029 
00030 """
00031   # Pseudo-constants
00032   COLLISION_SET_ALL = r'"all"'
00033   COLLISION_SET_OBJECTS = r'"objects"'
00034   COLLISION_SET_ATTACHED_OBJECTS = r'"attached"'
00035   DISABLE = 0
00036   ENABLE = 1
00037 
00038   __slots__ = ['object1','object2','penetration_distance','operation']
00039   _slot_types = ['string','string','float64','int32']
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        object1,object2,penetration_distance,operation
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(CollisionOperation, self).__init__(*args, **kwds)
00057       #message fields cannot be None, assign default values for those that are
00058       if self.object1 is None:
00059         self.object1 = ''
00060       if self.object2 is None:
00061         self.object2 = ''
00062       if self.penetration_distance is None:
00063         self.penetration_distance = 0.
00064       if self.operation is None:
00065         self.operation = 0
00066     else:
00067       self.object1 = ''
00068       self.object2 = ''
00069       self.penetration_distance = 0.
00070       self.operation = 0
00071 
00072   def _get_types(self):
00073     """
00074     internal API method
00075     """
00076     return self._slot_types
00077 
00078   def serialize(self, buff):
00079     """
00080     serialize message into buffer
00081     :param buff: buffer, ``StringIO``
00082     """
00083     try:
00084       _x = self.object1
00085       length = len(_x)
00086       if python3 or type(_x) == unicode:
00087         _x = _x.encode('utf-8')
00088         length = len(_x)
00089       buff.write(struct.pack('<I%ss'%length, length, _x))
00090       _x = self.object2
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096       _x = self
00097       buff.write(_struct_di.pack(_x.penetration_distance, _x.operation))
00098     except struct.error as se: self._check_types(se)
00099     except TypeError as te: self._check_types(te)
00100 
00101   def deserialize(self, str):
00102     """
00103     unpack serialized message in str into this message instance
00104     :param str: byte array of serialized message, ``str``
00105     """
00106     try:
00107       end = 0
00108       start = end
00109       end += 4
00110       (length,) = _struct_I.unpack(str[start:end])
00111       start = end
00112       end += length
00113       if python3:
00114         self.object1 = str[start:end].decode('utf-8')
00115       else:
00116         self.object1 = str[start:end]
00117       start = end
00118       end += 4
00119       (length,) = _struct_I.unpack(str[start:end])
00120       start = end
00121       end += length
00122       if python3:
00123         self.object2 = str[start:end].decode('utf-8')
00124       else:
00125         self.object2 = str[start:end]
00126       _x = self
00127       start = end
00128       end += 12
00129       (_x.penetration_distance, _x.operation,) = _struct_di.unpack(str[start:end])
00130       return self
00131     except struct.error as e:
00132       raise genpy.DeserializationError(e) #most likely buffer underfill
00133 
00134 
00135   def serialize_numpy(self, buff, numpy):
00136     """
00137     serialize message with numpy array types into buffer
00138     :param buff: buffer, ``StringIO``
00139     :param numpy: numpy python module
00140     """
00141     try:
00142       _x = self.object1
00143       length = len(_x)
00144       if python3 or type(_x) == unicode:
00145         _x = _x.encode('utf-8')
00146         length = len(_x)
00147       buff.write(struct.pack('<I%ss'%length, length, _x))
00148       _x = self.object2
00149       length = len(_x)
00150       if python3 or type(_x) == unicode:
00151         _x = _x.encode('utf-8')
00152         length = len(_x)
00153       buff.write(struct.pack('<I%ss'%length, length, _x))
00154       _x = self
00155       buff.write(_struct_di.pack(_x.penetration_distance, _x.operation))
00156     except struct.error as se: self._check_types(se)
00157     except TypeError as te: self._check_types(te)
00158 
00159   def deserialize_numpy(self, str, numpy):
00160     """
00161     unpack serialized message in str into this message instance using numpy for array types
00162     :param str: byte array of serialized message, ``str``
00163     :param numpy: numpy python module
00164     """
00165     try:
00166       end = 0
00167       start = end
00168       end += 4
00169       (length,) = _struct_I.unpack(str[start:end])
00170       start = end
00171       end += length
00172       if python3:
00173         self.object1 = str[start:end].decode('utf-8')
00174       else:
00175         self.object1 = str[start:end]
00176       start = end
00177       end += 4
00178       (length,) = _struct_I.unpack(str[start:end])
00179       start = end
00180       end += length
00181       if python3:
00182         self.object2 = str[start:end].decode('utf-8')
00183       else:
00184         self.object2 = str[start:end]
00185       _x = self
00186       start = end
00187       end += 12
00188       (_x.penetration_distance, _x.operation,) = _struct_di.unpack(str[start:end])
00189       return self
00190     except struct.error as e:
00191       raise genpy.DeserializationError(e) #most likely buffer underfill
00192 
00193 _struct_I = genpy.struct_I
00194 _struct_di = struct.Struct("<di")


arm_navigation_msgs
Author(s): Gil Jones
autogenerated on Thu Dec 12 2013 11:08:10