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