00001 """autogenerated by genmsg_py from TestRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_roslisp.msg
00006 import std_msgs.msg
00007
00008 class TestRequest(roslib.message.Message):
00009 _md5sum = "5d7b4abd379a003f0e74b4d5f3491f60"
00010 _type = "test_roslisp/TestRequest"
00011 _has_header = False
00012 _full_text = """test_roslisp/TwoInts m
00013
00014 ================================================================================
00015 MSG: test_roslisp/TwoInts
00016 std_msgs/Int16 a
00017 std_msgs/Int16 b
00018
00019 ================================================================================
00020 MSG: std_msgs/Int16
00021 int16 data
00022
00023 """
00024 __slots__ = ['m']
00025 _slot_types = ['test_roslisp/TwoInts']
00026
00027 def __init__(self, *args, **kwds):
00028 """
00029 Constructor. Any message fields that are implicitly/explicitly
00030 set to None will be assigned a default value. The recommend
00031 use is keyword arguments as this is more robust to future message
00032 changes. You cannot mix in-order arguments and keyword arguments.
00033
00034 The available fields are:
00035 m
00036
00037 @param args: complete set of field values, in .msg order
00038 @param kwds: use keyword arguments corresponding to message field names
00039 to set specific fields.
00040 """
00041 if args or kwds:
00042 super(TestRequest, self).__init__(*args, **kwds)
00043
00044 if self.m is None:
00045 self.m = test_roslisp.msg.TwoInts()
00046 else:
00047 self.m = test_roslisp.msg.TwoInts()
00048
00049 def _get_types(self):
00050 """
00051 internal API method
00052 """
00053 return self._slot_types
00054
00055 def serialize(self, buff):
00056 """
00057 serialize message into buffer
00058 @param buff: buffer
00059 @type buff: StringIO
00060 """
00061 try:
00062 _x = self
00063 buff.write(_struct_2h.pack(_x.m.a.data, _x.m.b.data))
00064 except struct.error, se: self._check_types(se)
00065 except TypeError, te: self._check_types(te)
00066
00067 def deserialize(self, str):
00068 """
00069 unpack serialized message in str into this message instance
00070 @param str: byte array of serialized message
00071 @type str: str
00072 """
00073 try:
00074 if self.m is None:
00075 self.m = test_roslisp.msg.TwoInts()
00076 end = 0
00077 _x = self
00078 start = end
00079 end += 4
00080 (_x.m.a.data, _x.m.b.data,) = _struct_2h.unpack(str[start:end])
00081 return self
00082 except struct.error, e:
00083 raise roslib.message.DeserializationError(e)
00084
00085
00086 def serialize_numpy(self, buff, numpy):
00087 """
00088 serialize message with numpy array types into buffer
00089 @param buff: buffer
00090 @type buff: StringIO
00091 @param numpy: numpy python module
00092 @type numpy module
00093 """
00094 try:
00095 _x = self
00096 buff.write(_struct_2h.pack(_x.m.a.data, _x.m.b.data))
00097 except struct.error, se: self._check_types(se)
00098 except TypeError, 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 if self.m is None:
00110 self.m = test_roslisp.msg.TwoInts()
00111 end = 0
00112 _x = self
00113 start = end
00114 end += 4
00115 (_x.m.a.data, _x.m.b.data,) = _struct_2h.unpack(str[start:end])
00116 return self
00117 except struct.error, e:
00118 raise roslib.message.DeserializationError(e)
00119
00120 _struct_I = roslib.message.struct_I
00121 _struct_2h = struct.Struct("<2h")
00122 """autogenerated by genmsg_py from TestResponse.msg. Do not edit."""
00123 import roslib.message
00124 import struct
00125
00126
00127 class TestResponse(roslib.message.Message):
00128 _md5sum = "b88405221c77b1878a3cbbfff53428d7"
00129 _type = "test_roslisp/TestResponse"
00130 _has_header = False
00131 _full_text = """int64 sum
00132
00133 """
00134 __slots__ = ['sum']
00135 _slot_types = ['int64']
00136
00137 def __init__(self, *args, **kwds):
00138 """
00139 Constructor. Any message fields that are implicitly/explicitly
00140 set to None will be assigned a default value. The recommend
00141 use is keyword arguments as this is more robust to future message
00142 changes. You cannot mix in-order arguments and keyword arguments.
00143
00144 The available fields are:
00145 sum
00146
00147 @param args: complete set of field values, in .msg order
00148 @param kwds: use keyword arguments corresponding to message field names
00149 to set specific fields.
00150 """
00151 if args or kwds:
00152 super(TestResponse, self).__init__(*args, **kwds)
00153
00154 if self.sum is None:
00155 self.sum = 0
00156 else:
00157 self.sum = 0
00158
00159 def _get_types(self):
00160 """
00161 internal API method
00162 """
00163 return self._slot_types
00164
00165 def serialize(self, buff):
00166 """
00167 serialize message into buffer
00168 @param buff: buffer
00169 @type buff: StringIO
00170 """
00171 try:
00172 buff.write(_struct_q.pack(self.sum))
00173 except struct.error, se: self._check_types(se)
00174 except TypeError, te: self._check_types(te)
00175
00176 def deserialize(self, str):
00177 """
00178 unpack serialized message in str into this message instance
00179 @param str: byte array of serialized message
00180 @type str: str
00181 """
00182 try:
00183 end = 0
00184 start = end
00185 end += 8
00186 (self.sum,) = _struct_q.unpack(str[start:end])
00187 return self
00188 except struct.error, e:
00189 raise roslib.message.DeserializationError(e)
00190
00191
00192 def serialize_numpy(self, buff, numpy):
00193 """
00194 serialize message with numpy array types into buffer
00195 @param buff: buffer
00196 @type buff: StringIO
00197 @param numpy: numpy python module
00198 @type numpy module
00199 """
00200 try:
00201 buff.write(_struct_q.pack(self.sum))
00202 except struct.error, se: self._check_types(se)
00203 except TypeError, te: self._check_types(te)
00204
00205 def deserialize_numpy(self, str, numpy):
00206 """
00207 unpack serialized message in str into this message instance using numpy for array types
00208 @param str: byte array of serialized message
00209 @type str: str
00210 @param numpy: numpy python module
00211 @type numpy: module
00212 """
00213 try:
00214 end = 0
00215 start = end
00216 end += 8
00217 (self.sum,) = _struct_q.unpack(str[start:end])
00218 return self
00219 except struct.error, e:
00220 raise roslib.message.DeserializationError(e)
00221
00222 _struct_I = roslib.message.struct_I
00223 _struct_q = struct.Struct("<q")
00224 class Test(roslib.message.ServiceDefinition):
00225 _type = 'test_roslisp/Test'
00226 _md5sum = '2e11e73de6ca62ddbaed898362aba0ad'
00227 _request_class = TestRequest
00228 _response_class = TestResponse