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