$search
00001 """autogenerated by genmsg_py from TwoInts.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class TwoInts(roslib.message.Message): 00008 _md5sum = "7f80fd04371aa5efefe6eae873a1958e" 00009 _type = "test_roslisp/TwoInts" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """std_msgs/Int16 a 00012 std_msgs/Int16 b 00013 00014 ================================================================================ 00015 MSG: std_msgs/Int16 00016 int16 data 00017 00018 """ 00019 __slots__ = ['a','b'] 00020 _slot_types = ['std_msgs/Int16','std_msgs/Int16'] 00021 00022 def __init__(self, *args, **kwds): 00023 """ 00024 Constructor. Any message fields that are implicitly/explicitly 00025 set to None will be assigned a default value. The recommend 00026 use is keyword arguments as this is more robust to future message 00027 changes. You cannot mix in-order arguments and keyword arguments. 00028 00029 The available fields are: 00030 a,b 00031 00032 @param args: complete set of field values, in .msg order 00033 @param kwds: use keyword arguments corresponding to message field names 00034 to set specific fields. 00035 """ 00036 if args or kwds: 00037 super(TwoInts, self).__init__(*args, **kwds) 00038 #message fields cannot be None, assign default values for those that are 00039 if self.a is None: 00040 self.a = std_msgs.msg.Int16() 00041 if self.b is None: 00042 self.b = std_msgs.msg.Int16() 00043 else: 00044 self.a = std_msgs.msg.Int16() 00045 self.b = std_msgs.msg.Int16() 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 00061 buff.write(_struct_2h.pack(_x.a.data, _x.b.data)) 00062 except struct.error as se: self._check_types(se) 00063 except TypeError as te: self._check_types(te) 00064 00065 def deserialize(self, str): 00066 """ 00067 unpack serialized message in str into this message instance 00068 @param str: byte array of serialized message 00069 @type str: str 00070 """ 00071 try: 00072 if self.a is None: 00073 self.a = std_msgs.msg.Int16() 00074 if self.b is None: 00075 self.b = std_msgs.msg.Int16() 00076 end = 0 00077 _x = self 00078 start = end 00079 end += 4 00080 (_x.a.data, _x.b.data,) = _struct_2h.unpack(str[start:end]) 00081 return self 00082 except struct.error as e: 00083 raise roslib.message.DeserializationError(e) #most likely buffer underfill 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.a.data, _x.b.data)) 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 if self.a is None: 00110 self.a = std_msgs.msg.Int16() 00111 if self.b is None: 00112 self.b = std_msgs.msg.Int16() 00113 end = 0 00114 _x = self 00115 start = end 00116 end += 4 00117 (_x.a.data, _x.b.data,) = _struct_2h.unpack(str[start:end]) 00118 return self 00119 except struct.error as e: 00120 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00121 00122 _struct_I = roslib.message.struct_I 00123 _struct_2h = struct.Struct("<2h")