$search
00001 """autogenerated by genmsg_py from Poison.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class Poison(roslib.message.Message): 00007 _md5sum = "b16420a6fd4cc18f64b776ee10e98bb0" 00008 _type = "brics_actuator/Poison" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string originator # node id 00011 string description # encoding still an issue 00012 float32 qos # reliability of the channel 00013 # 0..1 where 1 means healthy 00014 00015 """ 00016 __slots__ = ['originator','description','qos'] 00017 _slot_types = ['string','string','float32'] 00018 00019 def __init__(self, *args, **kwds): 00020 """ 00021 Constructor. Any message fields that are implicitly/explicitly 00022 set to None will be assigned a default value. The recommend 00023 use is keyword arguments as this is more robust to future message 00024 changes. You cannot mix in-order arguments and keyword arguments. 00025 00026 The available fields are: 00027 originator,description,qos 00028 00029 @param args: complete set of field values, in .msg order 00030 @param kwds: use keyword arguments corresponding to message field names 00031 to set specific fields. 00032 """ 00033 if args or kwds: 00034 super(Poison, self).__init__(*args, **kwds) 00035 #message fields cannot be None, assign default values for those that are 00036 if self.originator is None: 00037 self.originator = '' 00038 if self.description is None: 00039 self.description = '' 00040 if self.qos is None: 00041 self.qos = 0. 00042 else: 00043 self.originator = '' 00044 self.description = '' 00045 self.qos = 0. 00046 00047 def _get_types(self): 00048 """ 00049 internal API method 00050 """ 00051 return self._slot_types 00052 00053 def serialize(self, buff): 00054 """ 00055 serialize message into buffer 00056 @param buff: buffer 00057 @type buff: StringIO 00058 """ 00059 try: 00060 _x = self.originator 00061 length = len(_x) 00062 buff.write(struct.pack('<I%ss'%length, length, _x)) 00063 _x = self.description 00064 length = len(_x) 00065 buff.write(struct.pack('<I%ss'%length, length, _x)) 00066 buff.write(_struct_f.pack(self.qos)) 00067 except struct.error as se: self._check_types(se) 00068 except TypeError as te: self._check_types(te) 00069 00070 def deserialize(self, str): 00071 """ 00072 unpack serialized message in str into this message instance 00073 @param str: byte array of serialized message 00074 @type str: str 00075 """ 00076 try: 00077 end = 0 00078 start = end 00079 end += 4 00080 (length,) = _struct_I.unpack(str[start:end]) 00081 start = end 00082 end += length 00083 self.originator = str[start:end] 00084 start = end 00085 end += 4 00086 (length,) = _struct_I.unpack(str[start:end]) 00087 start = end 00088 end += length 00089 self.description = str[start:end] 00090 start = end 00091 end += 4 00092 (self.qos,) = _struct_f.unpack(str[start:end]) 00093 return self 00094 except struct.error as e: 00095 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00096 00097 00098 def serialize_numpy(self, buff, numpy): 00099 """ 00100 serialize message with numpy array types into buffer 00101 @param buff: buffer 00102 @type buff: StringIO 00103 @param numpy: numpy python module 00104 @type numpy module 00105 """ 00106 try: 00107 _x = self.originator 00108 length = len(_x) 00109 buff.write(struct.pack('<I%ss'%length, length, _x)) 00110 _x = self.description 00111 length = len(_x) 00112 buff.write(struct.pack('<I%ss'%length, length, _x)) 00113 buff.write(_struct_f.pack(self.qos)) 00114 except struct.error as se: self._check_types(se) 00115 except TypeError as te: self._check_types(te) 00116 00117 def deserialize_numpy(self, str, numpy): 00118 """ 00119 unpack serialized message in str into this message instance using numpy for array types 00120 @param str: byte array of serialized message 00121 @type str: str 00122 @param numpy: numpy python module 00123 @type numpy: module 00124 """ 00125 try: 00126 end = 0 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 start = end 00131 end += length 00132 self.originator = str[start:end] 00133 start = end 00134 end += 4 00135 (length,) = _struct_I.unpack(str[start:end]) 00136 start = end 00137 end += length 00138 self.description = str[start:end] 00139 start = end 00140 end += 4 00141 (self.qos,) = _struct_f.unpack(str[start:end]) 00142 return self 00143 except struct.error as e: 00144 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00145 00146 _struct_I = roslib.message.struct_I 00147 _struct_f = struct.Struct("<f")