$search
00001 """autogenerated by genmsg_py from SimpleMotorFlasherRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class SimpleMotorFlasherRequest(roslib.message.Message): 00007 _md5sum = "95979d9c30a49ed16e3ab17fe0edb157" 00008 _type = "sr_robot_msgs/SimpleMotorFlasherRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string firmware 00011 int8 motor_id 00012 00013 """ 00014 __slots__ = ['firmware','motor_id'] 00015 _slot_types = ['string','int8'] 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 firmware,motor_id 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(SimpleMotorFlasherRequest, self).__init__(*args, **kwds) 00033 #message fields cannot be None, assign default values for those that are 00034 if self.firmware is None: 00035 self.firmware = '' 00036 if self.motor_id is None: 00037 self.motor_id = 0 00038 else: 00039 self.firmware = '' 00040 self.motor_id = 0 00041 00042 def _get_types(self): 00043 """ 00044 internal API method 00045 """ 00046 return self._slot_types 00047 00048 def serialize(self, buff): 00049 """ 00050 serialize message into buffer 00051 @param buff: buffer 00052 @type buff: StringIO 00053 """ 00054 try: 00055 _x = self.firmware 00056 length = len(_x) 00057 buff.write(struct.pack('<I%ss'%length, length, _x)) 00058 buff.write(_struct_b.pack(self.motor_id)) 00059 except struct.error as se: self._check_types(se) 00060 except TypeError as te: self._check_types(te) 00061 00062 def deserialize(self, str): 00063 """ 00064 unpack serialized message in str into this message instance 00065 @param str: byte array of serialized message 00066 @type str: str 00067 """ 00068 try: 00069 end = 0 00070 start = end 00071 end += 4 00072 (length,) = _struct_I.unpack(str[start:end]) 00073 start = end 00074 end += length 00075 self.firmware = str[start:end] 00076 start = end 00077 end += 1 00078 (self.motor_id,) = _struct_b.unpack(str[start:end]) 00079 return self 00080 except struct.error as e: 00081 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00082 00083 00084 def serialize_numpy(self, buff, numpy): 00085 """ 00086 serialize message with numpy array types into buffer 00087 @param buff: buffer 00088 @type buff: StringIO 00089 @param numpy: numpy python module 00090 @type numpy module 00091 """ 00092 try: 00093 _x = self.firmware 00094 length = len(_x) 00095 buff.write(struct.pack('<I%ss'%length, length, _x)) 00096 buff.write(_struct_b.pack(self.motor_id)) 00097 except struct.error as se: self._check_types(se) 00098 except TypeError as te: self._check_types(te) 00099 00100 def deserialize_numpy(self, str, numpy): 00101 """ 00102 unpack serialized message in str into this message instance using numpy for array types 00103 @param str: byte array of serialized message 00104 @type str: str 00105 @param numpy: numpy python module 00106 @type numpy: module 00107 """ 00108 try: 00109 end = 0 00110 start = end 00111 end += 4 00112 (length,) = _struct_I.unpack(str[start:end]) 00113 start = end 00114 end += length 00115 self.firmware = str[start:end] 00116 start = end 00117 end += 1 00118 (self.motor_id,) = _struct_b.unpack(str[start:end]) 00119 return self 00120 except struct.error as e: 00121 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00122 00123 _struct_I = roslib.message.struct_I 00124 _struct_b = struct.Struct("<b") 00125 """autogenerated by genmsg_py from SimpleMotorFlasherResponse.msg. Do not edit.""" 00126 import roslib.message 00127 import struct 00128 00129 00130 class SimpleMotorFlasherResponse(roslib.message.Message): 00131 _md5sum = "57a3be4812415ba24758cca00aebf53f" 00132 _type = "sr_robot_msgs/SimpleMotorFlasherResponse" 00133 _has_header = False #flag to mark the presence of a Header object 00134 _full_text = """int32 value 00135 00136 int32 SUCCESS = 0 00137 int32 FAIL = 1 00138 00139 00140 """ 00141 # Pseudo-constants 00142 SUCCESS = 0 00143 FAIL = 1 00144 00145 __slots__ = ['value'] 00146 _slot_types = ['int32'] 00147 00148 def __init__(self, *args, **kwds): 00149 """ 00150 Constructor. Any message fields that are implicitly/explicitly 00151 set to None will be assigned a default value. The recommend 00152 use is keyword arguments as this is more robust to future message 00153 changes. You cannot mix in-order arguments and keyword arguments. 00154 00155 The available fields are: 00156 value 00157 00158 @param args: complete set of field values, in .msg order 00159 @param kwds: use keyword arguments corresponding to message field names 00160 to set specific fields. 00161 """ 00162 if args or kwds: 00163 super(SimpleMotorFlasherResponse, self).__init__(*args, **kwds) 00164 #message fields cannot be None, assign default values for those that are 00165 if self.value is None: 00166 self.value = 0 00167 else: 00168 self.value = 0 00169 00170 def _get_types(self): 00171 """ 00172 internal API method 00173 """ 00174 return self._slot_types 00175 00176 def serialize(self, buff): 00177 """ 00178 serialize message into buffer 00179 @param buff: buffer 00180 @type buff: StringIO 00181 """ 00182 try: 00183 buff.write(_struct_i.pack(self.value)) 00184 except struct.error as se: self._check_types(se) 00185 except TypeError as te: self._check_types(te) 00186 00187 def deserialize(self, str): 00188 """ 00189 unpack serialized message in str into this message instance 00190 @param str: byte array of serialized message 00191 @type str: str 00192 """ 00193 try: 00194 end = 0 00195 start = end 00196 end += 4 00197 (self.value,) = _struct_i.unpack(str[start:end]) 00198 return self 00199 except struct.error as e: 00200 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00201 00202 00203 def serialize_numpy(self, buff, numpy): 00204 """ 00205 serialize message with numpy array types into buffer 00206 @param buff: buffer 00207 @type buff: StringIO 00208 @param numpy: numpy python module 00209 @type numpy module 00210 """ 00211 try: 00212 buff.write(_struct_i.pack(self.value)) 00213 except struct.error as se: self._check_types(se) 00214 except TypeError as te: self._check_types(te) 00215 00216 def deserialize_numpy(self, str, numpy): 00217 """ 00218 unpack serialized message in str into this message instance using numpy for array types 00219 @param str: byte array of serialized message 00220 @type str: str 00221 @param numpy: numpy python module 00222 @type numpy: module 00223 """ 00224 try: 00225 end = 0 00226 start = end 00227 end += 4 00228 (self.value,) = _struct_i.unpack(str[start:end]) 00229 return self 00230 except struct.error as e: 00231 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00232 00233 _struct_I = roslib.message.struct_I 00234 _struct_i = struct.Struct("<i") 00235 class SimpleMotorFlasher(roslib.message.ServiceDefinition): 00236 _type = 'sr_robot_msgs/SimpleMotorFlasher' 00237 _md5sum = 'b5e4cd4b44ed54dd8f018caf24a9e0c1' 00238 _request_class = SimpleMotorFlasherRequest 00239 _response_class = SimpleMotorFlasherResponse