$search
00001 """autogenerated by genmsg_py from CollisionOperation.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class CollisionOperation(roslib.message.Message): 00007 _md5sum = "e0cf3073b26bd86266c918a0c779f8a2" 00008 _type = "arm_navigation_msgs/CollisionOperation" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# A definition of a collision operation 00011 # E.g. ("gripper",COLLISION_SET_ALL,ENABLE) will enable collisions 00012 # between the gripper and all objects in the collision space 00013 00014 string object1 00015 string object2 00016 string COLLISION_SET_ALL="all" 00017 string COLLISION_SET_OBJECTS="objects" 00018 string COLLISION_SET_ATTACHED_OBJECTS="attached" 00019 00020 # The penetration distance to which collisions are allowed. This is 0.0 by default. 00021 float64 penetration_distance 00022 00023 # Flag that determines whether collisions will be enabled or disabled for the pair of objects specified above 00024 int32 operation 00025 int32 DISABLE=0 00026 int32 ENABLE=1 00027 00028 """ 00029 # Pseudo-constants 00030 COLLISION_SET_ALL = r'"all"' 00031 COLLISION_SET_OBJECTS = r'"objects"' 00032 COLLISION_SET_ATTACHED_OBJECTS = r'"attached"' 00033 DISABLE = 0 00034 ENABLE = 1 00035 00036 __slots__ = ['object1','object2','penetration_distance','operation'] 00037 _slot_types = ['string','string','float64','int32'] 00038 00039 def __init__(self, *args, **kwds): 00040 """ 00041 Constructor. Any message fields that are implicitly/explicitly 00042 set to None will be assigned a default value. The recommend 00043 use is keyword arguments as this is more robust to future message 00044 changes. You cannot mix in-order arguments and keyword arguments. 00045 00046 The available fields are: 00047 object1,object2,penetration_distance,operation 00048 00049 @param args: complete set of field values, in .msg order 00050 @param kwds: use keyword arguments corresponding to message field names 00051 to set specific fields. 00052 """ 00053 if args or kwds: 00054 super(CollisionOperation, self).__init__(*args, **kwds) 00055 #message fields cannot be None, assign default values for those that are 00056 if self.object1 is None: 00057 self.object1 = '' 00058 if self.object2 is None: 00059 self.object2 = '' 00060 if self.penetration_distance is None: 00061 self.penetration_distance = 0. 00062 if self.operation is None: 00063 self.operation = 0 00064 else: 00065 self.object1 = '' 00066 self.object2 = '' 00067 self.penetration_distance = 0. 00068 self.operation = 0 00069 00070 def _get_types(self): 00071 """ 00072 internal API method 00073 """ 00074 return self._slot_types 00075 00076 def serialize(self, buff): 00077 """ 00078 serialize message into buffer 00079 @param buff: buffer 00080 @type buff: StringIO 00081 """ 00082 try: 00083 _x = self.object1 00084 length = len(_x) 00085 buff.write(struct.pack('<I%ss'%length, length, _x)) 00086 _x = self.object2 00087 length = len(_x) 00088 buff.write(struct.pack('<I%ss'%length, length, _x)) 00089 _x = self 00090 buff.write(_struct_di.pack(_x.penetration_distance, _x.operation)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 end = 0 00102 start = end 00103 end += 4 00104 (length,) = _struct_I.unpack(str[start:end]) 00105 start = end 00106 end += length 00107 self.object1 = str[start:end] 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 start = end 00112 end += length 00113 self.object2 = str[start:end] 00114 _x = self 00115 start = end 00116 end += 12 00117 (_x.penetration_distance, _x.operation,) = _struct_di.unpack(str[start:end]) 00118 return self 00119 except struct.error as e: 00120 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00121 00122 00123 def serialize_numpy(self, buff, numpy): 00124 """ 00125 serialize message with numpy array types into buffer 00126 @param buff: buffer 00127 @type buff: StringIO 00128 @param numpy: numpy python module 00129 @type numpy module 00130 """ 00131 try: 00132 _x = self.object1 00133 length = len(_x) 00134 buff.write(struct.pack('<I%ss'%length, length, _x)) 00135 _x = self.object2 00136 length = len(_x) 00137 buff.write(struct.pack('<I%ss'%length, length, _x)) 00138 _x = self 00139 buff.write(_struct_di.pack(_x.penetration_distance, _x.operation)) 00140 except struct.error as se: self._check_types(se) 00141 except TypeError as te: self._check_types(te) 00142 00143 def deserialize_numpy(self, str, numpy): 00144 """ 00145 unpack serialized message in str into this message instance using numpy for array types 00146 @param str: byte array of serialized message 00147 @type str: str 00148 @param numpy: numpy python module 00149 @type numpy: module 00150 """ 00151 try: 00152 end = 0 00153 start = end 00154 end += 4 00155 (length,) = _struct_I.unpack(str[start:end]) 00156 start = end 00157 end += length 00158 self.object1 = str[start:end] 00159 start = end 00160 end += 4 00161 (length,) = _struct_I.unpack(str[start:end]) 00162 start = end 00163 end += length 00164 self.object2 = str[start:end] 00165 _x = self 00166 start = end 00167 end += 12 00168 (_x.penetration_distance, _x.operation,) = _struct_di.unpack(str[start:end]) 00169 return self 00170 except struct.error as e: 00171 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00172 00173 _struct_I = roslib.message.struct_I 00174 _struct_di = struct.Struct("<di")