$search
00001 """autogenerated by genmsg_py from AllowedCollisionEntry.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class AllowedCollisionEntry(roslib.message.Message): 00007 _md5sum = "90d1ae1850840724bb043562fe3285fc" 00008 _type = "arm_navigation_msgs/AllowedCollisionEntry" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# whether or not collision checking is enabled 00011 bool[] enabled 00012 00013 """ 00014 __slots__ = ['enabled'] 00015 _slot_types = ['bool[]'] 00016 00017 def __init__(self, *args, **kwds): 00018 """ 00019 Constructor. Any message fields that are implicitly/explicitly 00020 set to None will be assigned a default value. The recommend 00021 use is keyword arguments as this is more robust to future message 00022 changes. You cannot mix in-order arguments and keyword arguments. 00023 00024 The available fields are: 00025 enabled 00026 00027 @param args: complete set of field values, in .msg order 00028 @param kwds: use keyword arguments corresponding to message field names 00029 to set specific fields. 00030 """ 00031 if args or kwds: 00032 super(AllowedCollisionEntry, self).__init__(*args, **kwds) 00033 #message fields cannot be None, assign default values for those that are 00034 if self.enabled is None: 00035 self.enabled = [] 00036 else: 00037 self.enabled = [] 00038 00039 def _get_types(self): 00040 """ 00041 internal API method 00042 """ 00043 return self._slot_types 00044 00045 def serialize(self, buff): 00046 """ 00047 serialize message into buffer 00048 @param buff: buffer 00049 @type buff: StringIO 00050 """ 00051 try: 00052 length = len(self.enabled) 00053 buff.write(_struct_I.pack(length)) 00054 pattern = '<%sB'%length 00055 buff.write(struct.pack(pattern, *self.enabled)) 00056 except struct.error as se: self._check_types(se) 00057 except TypeError as te: self._check_types(te) 00058 00059 def deserialize(self, str): 00060 """ 00061 unpack serialized message in str into this message instance 00062 @param str: byte array of serialized message 00063 @type str: str 00064 """ 00065 try: 00066 end = 0 00067 start = end 00068 end += 4 00069 (length,) = _struct_I.unpack(str[start:end]) 00070 pattern = '<%sB'%length 00071 start = end 00072 end += struct.calcsize(pattern) 00073 self.enabled = struct.unpack(pattern, str[start:end]) 00074 self.enabled = map(bool, self.enabled) 00075 return self 00076 except struct.error as e: 00077 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00078 00079 00080 def serialize_numpy(self, buff, numpy): 00081 """ 00082 serialize message with numpy array types into buffer 00083 @param buff: buffer 00084 @type buff: StringIO 00085 @param numpy: numpy python module 00086 @type numpy module 00087 """ 00088 try: 00089 length = len(self.enabled) 00090 buff.write(_struct_I.pack(length)) 00091 pattern = '<%sB'%length 00092 buff.write(self.enabled.tostring()) 00093 except struct.error as se: self._check_types(se) 00094 except TypeError as te: self._check_types(te) 00095 00096 def deserialize_numpy(self, str, numpy): 00097 """ 00098 unpack serialized message in str into this message instance using numpy for array types 00099 @param str: byte array of serialized message 00100 @type str: str 00101 @param numpy: numpy python module 00102 @type numpy: module 00103 """ 00104 try: 00105 end = 0 00106 start = end 00107 end += 4 00108 (length,) = _struct_I.unpack(str[start:end]) 00109 pattern = '<%sB'%length 00110 start = end 00111 end += struct.calcsize(pattern) 00112 self.enabled = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length) 00113 self.enabled = map(bool, self.enabled) 00114 return self 00115 except struct.error as e: 00116 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00117 00118 _struct_I = roslib.message.struct_I