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