00001 """autogenerated by genmsg_py from SetAllowedCollisionsRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import motion_planning_msgs.msg
00006
00007 class SetAllowedCollisionsRequest(roslib.message.Message):
00008 _md5sum = "65c7c509a65301718d2c95e5eecf2f05"
00009 _type = "planning_environment_msgs/SetAllowedCollisionsRequest"
00010 _has_header = False
00011 _full_text = """
00012
00013 motion_planning_msgs/OrderedCollisionOperations ord
00014
00015 ================================================================================
00016 MSG: motion_planning_msgs/OrderedCollisionOperations
00017 # A set of collision operations that will be performed in the order they are specified
00018 CollisionOperation[] collision_operations
00019 ================================================================================
00020 MSG: motion_planning_msgs/CollisionOperation
00021 # A definition of a collision operation
00022 # E.g. ("gripper",COLLISION_SET_ALL,ENABLE) will enable collisions
00023 # between the gripper and all objects in the collision space
00024
00025 string object1
00026 string object2
00027 string COLLISION_SET_ALL="all"
00028 string COLLISION_SET_OBJECTS="objects"
00029 string COLLISION_SET_ATTACHED_OBJECTS="attached"
00030
00031 # The penetration distance to which collisions are allowed. This is 0.0 by default.
00032 float64 penetration_distance
00033
00034 # Flag that determines whether collisions will be enabled or disabled for the pair of objects specified above
00035 int32 operation
00036 int32 DISABLE=0
00037 int32 ENABLE=1
00038
00039 """
00040 __slots__ = ['ord']
00041 _slot_types = ['motion_planning_msgs/OrderedCollisionOperations']
00042
00043 def __init__(self, *args, **kwds):
00044 """
00045 Constructor. Any message fields that are implicitly/explicitly
00046 set to None will be assigned a default value. The recommend
00047 use is keyword arguments as this is more robust to future message
00048 changes. You cannot mix in-order arguments and keyword arguments.
00049
00050 The available fields are:
00051 ord
00052
00053 @param args: complete set of field values, in .msg order
00054 @param kwds: use keyword arguments corresponding to message field names
00055 to set specific fields.
00056 """
00057 if args or kwds:
00058 super(SetAllowedCollisionsRequest, self).__init__(*args, **kwds)
00059
00060 if self.ord is None:
00061 self.ord = motion_planning_msgs.msg.OrderedCollisionOperations()
00062 else:
00063 self.ord = motion_planning_msgs.msg.OrderedCollisionOperations()
00064
00065 def _get_types(self):
00066 """
00067 internal API method
00068 """
00069 return self._slot_types
00070
00071 def serialize(self, buff):
00072 """
00073 serialize message into buffer
00074 @param buff: buffer
00075 @type buff: StringIO
00076 """
00077 try:
00078 length = len(self.ord.collision_operations)
00079 buff.write(_struct_I.pack(length))
00080 for val1 in self.ord.collision_operations:
00081 _x = val1.object1
00082 length = len(_x)
00083 buff.write(struct.pack('<I%ss'%length, length, _x))
00084 _x = val1.object2
00085 length = len(_x)
00086 buff.write(struct.pack('<I%ss'%length, length, _x))
00087 _x = val1
00088 buff.write(_struct_di.pack(_x.penetration_distance, _x.operation))
00089 except struct.error, se: self._check_types(se)
00090 except TypeError, te: self._check_types(te)
00091
00092 def deserialize(self, str):
00093 """
00094 unpack serialized message in str into this message instance
00095 @param str: byte array of serialized message
00096 @type str: str
00097 """
00098 try:
00099 if self.ord is None:
00100 self.ord = motion_planning_msgs.msg.OrderedCollisionOperations()
00101 end = 0
00102 start = end
00103 end += 4
00104 (length,) = _struct_I.unpack(str[start:end])
00105 self.ord.collision_operations = []
00106 for i in xrange(0, length):
00107 val1 = motion_planning_msgs.msg.CollisionOperation()
00108 start = end
00109 end += 4
00110 (length,) = _struct_I.unpack(str[start:end])
00111 start = end
00112 end += length
00113 val1.object1 = str[start:end]
00114 start = end
00115 end += 4
00116 (length,) = _struct_I.unpack(str[start:end])
00117 start = end
00118 end += length
00119 val1.object2 = str[start:end]
00120 _x = val1
00121 start = end
00122 end += 12
00123 (_x.penetration_distance, _x.operation,) = _struct_di.unpack(str[start:end])
00124 self.ord.collision_operations.append(val1)
00125 return self
00126 except struct.error, e:
00127 raise roslib.message.DeserializationError(e)
00128
00129
00130 def serialize_numpy(self, buff, numpy):
00131 """
00132 serialize message with numpy array types into buffer
00133 @param buff: buffer
00134 @type buff: StringIO
00135 @param numpy: numpy python module
00136 @type numpy module
00137 """
00138 try:
00139 length = len(self.ord.collision_operations)
00140 buff.write(_struct_I.pack(length))
00141 for val1 in self.ord.collision_operations:
00142 _x = val1.object1
00143 length = len(_x)
00144 buff.write(struct.pack('<I%ss'%length, length, _x))
00145 _x = val1.object2
00146 length = len(_x)
00147 buff.write(struct.pack('<I%ss'%length, length, _x))
00148 _x = val1
00149 buff.write(_struct_di.pack(_x.penetration_distance, _x.operation))
00150 except struct.error, se: self._check_types(se)
00151 except TypeError, te: self._check_types(te)
00152
00153 def deserialize_numpy(self, str, numpy):
00154 """
00155 unpack serialized message in str into this message instance using numpy for array types
00156 @param str: byte array of serialized message
00157 @type str: str
00158 @param numpy: numpy python module
00159 @type numpy: module
00160 """
00161 try:
00162 if self.ord is None:
00163 self.ord = motion_planning_msgs.msg.OrderedCollisionOperations()
00164 end = 0
00165 start = end
00166 end += 4
00167 (length,) = _struct_I.unpack(str[start:end])
00168 self.ord.collision_operations = []
00169 for i in xrange(0, length):
00170 val1 = motion_planning_msgs.msg.CollisionOperation()
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 start = end
00175 end += length
00176 val1.object1 = str[start:end]
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 val1.object2 = str[start:end]
00183 _x = val1
00184 start = end
00185 end += 12
00186 (_x.penetration_distance, _x.operation,) = _struct_di.unpack(str[start:end])
00187 self.ord.collision_operations.append(val1)
00188 return self
00189 except struct.error, e:
00190 raise roslib.message.DeserializationError(e)
00191
00192 _struct_I = roslib.message.struct_I
00193 _struct_di = struct.Struct("<di")
00194 """autogenerated by genmsg_py from SetAllowedCollisionsResponse.msg. Do not edit."""
00195 import roslib.message
00196 import struct
00197
00198 import planning_environment_msgs.msg
00199
00200 class SetAllowedCollisionsResponse(roslib.message.Message):
00201 _md5sum = "1f99ed5f743c8937d1578d6a9d9f8fda"
00202 _type = "planning_environment_msgs/SetAllowedCollisionsResponse"
00203 _has_header = False
00204 _full_text = """
00205 AllowedCollisionMatrix matrix
00206
00207
00208 ================================================================================
00209 MSG: planning_environment_msgs/AllowedCollisionMatrix
00210 # the list of link names in the matrix
00211 string[] link_names
00212
00213 # the individual entries in the allowed collision matrix
00214 # symmetric, with same order as link_names
00215 AllowedCollisionEntry[] entries
00216
00217 ================================================================================
00218 MSG: planning_environment_msgs/AllowedCollisionEntry
00219 # whether or not collision checking is enabled
00220 bool[] enabled
00221
00222 """
00223 __slots__ = ['matrix']
00224 _slot_types = ['planning_environment_msgs/AllowedCollisionMatrix']
00225
00226 def __init__(self, *args, **kwds):
00227 """
00228 Constructor. Any message fields that are implicitly/explicitly
00229 set to None will be assigned a default value. The recommend
00230 use is keyword arguments as this is more robust to future message
00231 changes. You cannot mix in-order arguments and keyword arguments.
00232
00233 The available fields are:
00234 matrix
00235
00236 @param args: complete set of field values, in .msg order
00237 @param kwds: use keyword arguments corresponding to message field names
00238 to set specific fields.
00239 """
00240 if args or kwds:
00241 super(SetAllowedCollisionsResponse, self).__init__(*args, **kwds)
00242
00243 if self.matrix is None:
00244 self.matrix = planning_environment_msgs.msg.AllowedCollisionMatrix()
00245 else:
00246 self.matrix = planning_environment_msgs.msg.AllowedCollisionMatrix()
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
00258 @type buff: StringIO
00259 """
00260 try:
00261 length = len(self.matrix.link_names)
00262 buff.write(_struct_I.pack(length))
00263 for val1 in self.matrix.link_names:
00264 length = len(val1)
00265 buff.write(struct.pack('<I%ss'%length, length, val1))
00266 length = len(self.matrix.entries)
00267 buff.write(_struct_I.pack(length))
00268 for val1 in self.matrix.entries:
00269 length = len(val1.enabled)
00270 buff.write(_struct_I.pack(length))
00271 pattern = '<%sB'%length
00272 buff.write(struct.pack(pattern, *val1.enabled))
00273 except struct.error, se: self._check_types(se)
00274 except TypeError, te: self._check_types(te)
00275
00276 def deserialize(self, str):
00277 """
00278 unpack serialized message in str into this message instance
00279 @param str: byte array of serialized message
00280 @type str: str
00281 """
00282 try:
00283 if self.matrix is None:
00284 self.matrix = planning_environment_msgs.msg.AllowedCollisionMatrix()
00285 end = 0
00286 start = end
00287 end += 4
00288 (length,) = _struct_I.unpack(str[start:end])
00289 self.matrix.link_names = []
00290 for i in xrange(0, length):
00291 start = end
00292 end += 4
00293 (length,) = _struct_I.unpack(str[start:end])
00294 start = end
00295 end += length
00296 val1 = str[start:end]
00297 self.matrix.link_names.append(val1)
00298 start = end
00299 end += 4
00300 (length,) = _struct_I.unpack(str[start:end])
00301 self.matrix.entries = []
00302 for i in xrange(0, length):
00303 val1 = planning_environment_msgs.msg.AllowedCollisionEntry()
00304 start = end
00305 end += 4
00306 (length,) = _struct_I.unpack(str[start:end])
00307 pattern = '<%sB'%length
00308 start = end
00309 end += struct.calcsize(pattern)
00310 val1.enabled = struct.unpack(pattern, str[start:end])
00311 val1.enabled = map(bool, val1.enabled)
00312 self.matrix.entries.append(val1)
00313 return self
00314 except struct.error, e:
00315 raise roslib.message.DeserializationError(e)
00316
00317
00318 def serialize_numpy(self, buff, numpy):
00319 """
00320 serialize message with numpy array types into buffer
00321 @param buff: buffer
00322 @type buff: StringIO
00323 @param numpy: numpy python module
00324 @type numpy module
00325 """
00326 try:
00327 length = len(self.matrix.link_names)
00328 buff.write(_struct_I.pack(length))
00329 for val1 in self.matrix.link_names:
00330 length = len(val1)
00331 buff.write(struct.pack('<I%ss'%length, length, val1))
00332 length = len(self.matrix.entries)
00333 buff.write(_struct_I.pack(length))
00334 for val1 in self.matrix.entries:
00335 length = len(val1.enabled)
00336 buff.write(_struct_I.pack(length))
00337 pattern = '<%sB'%length
00338 buff.write(val1.enabled.tostring())
00339 except struct.error, se: self._check_types(se)
00340 except TypeError, te: self._check_types(te)
00341
00342 def deserialize_numpy(self, str, numpy):
00343 """
00344 unpack serialized message in str into this message instance using numpy for array types
00345 @param str: byte array of serialized message
00346 @type str: str
00347 @param numpy: numpy python module
00348 @type numpy: module
00349 """
00350 try:
00351 if self.matrix is None:
00352 self.matrix = planning_environment_msgs.msg.AllowedCollisionMatrix()
00353 end = 0
00354 start = end
00355 end += 4
00356 (length,) = _struct_I.unpack(str[start:end])
00357 self.matrix.link_names = []
00358 for i in xrange(0, length):
00359 start = end
00360 end += 4
00361 (length,) = _struct_I.unpack(str[start:end])
00362 start = end
00363 end += length
00364 val1 = str[start:end]
00365 self.matrix.link_names.append(val1)
00366 start = end
00367 end += 4
00368 (length,) = _struct_I.unpack(str[start:end])
00369 self.matrix.entries = []
00370 for i in xrange(0, length):
00371 val1 = planning_environment_msgs.msg.AllowedCollisionEntry()
00372 start = end
00373 end += 4
00374 (length,) = _struct_I.unpack(str[start:end])
00375 pattern = '<%sB'%length
00376 start = end
00377 end += struct.calcsize(pattern)
00378 val1.enabled = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length)
00379 val1.enabled = map(bool, val1.enabled)
00380 self.matrix.entries.append(val1)
00381 return self
00382 except struct.error, e:
00383 raise roslib.message.DeserializationError(e)
00384
00385 _struct_I = roslib.message.struct_I
00386 class SetAllowedCollisions(roslib.message.ServiceDefinition):
00387 _type = 'planning_environment_msgs/SetAllowedCollisions'
00388 _md5sum = '471f0382adb33eececdc32c89881d3a0'
00389 _request_class = SetAllowedCollisionsRequest
00390 _response_class = SetAllowedCollisionsResponse