$search
00001 """autogenerated by genmsg_py from TactileArray.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import sr_robot_msgs.msg 00006 import std_msgs.msg 00007 00008 class TactileArray(roslib.message.Message): 00009 _md5sum = "294a763b90cb1a333d263f2097d3254e" 00010 _type = "sr_robot_msgs/TactileArray" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 Tactile[] data 00014 00015 ================================================================================ 00016 MSG: std_msgs/Header 00017 # Standard metadata for higher-level stamped data types. 00018 # This is generally used to communicate timestamped data 00019 # in a particular coordinate frame. 00020 # 00021 # sequence ID: consecutively increasing ID 00022 uint32 seq 00023 #Two-integer timestamp that is expressed as: 00024 # * stamp.secs: seconds (stamp_secs) since epoch 00025 # * stamp.nsecs: nanoseconds since stamp_secs 00026 # time-handling sugar is provided by the client library 00027 time stamp 00028 #Frame this data is associated with 00029 # 0: no frame 00030 # 1: global frame 00031 string frame_id 00032 00033 ================================================================================ 00034 MSG: sr_robot_msgs/Tactile 00035 std_msgs/Int16[] data 00036 00037 ================================================================================ 00038 MSG: std_msgs/Int16 00039 int16 data 00040 00041 """ 00042 __slots__ = ['header','data'] 00043 _slot_types = ['Header','sr_robot_msgs/Tactile[]'] 00044 00045 def __init__(self, *args, **kwds): 00046 """ 00047 Constructor. Any message fields that are implicitly/explicitly 00048 set to None will be assigned a default value. The recommend 00049 use is keyword arguments as this is more robust to future message 00050 changes. You cannot mix in-order arguments and keyword arguments. 00051 00052 The available fields are: 00053 header,data 00054 00055 @param args: complete set of field values, in .msg order 00056 @param kwds: use keyword arguments corresponding to message field names 00057 to set specific fields. 00058 """ 00059 if args or kwds: 00060 super(TactileArray, self).__init__(*args, **kwds) 00061 #message fields cannot be None, assign default values for those that are 00062 if self.header is None: 00063 self.header = std_msgs.msg._Header.Header() 00064 if self.data is None: 00065 self.data = [] 00066 else: 00067 self.header = std_msgs.msg._Header.Header() 00068 self.data = [] 00069 00070 def _get_types(self): 00071 """ 00072 internal API method 00073 """ 00074 return self._slot_types 00075 00076 def serialize(self, buff): 00077 """ 00078 serialize message into buffer 00079 @param buff: buffer 00080 @type buff: StringIO 00081 """ 00082 try: 00083 _x = self 00084 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00085 _x = self.header.frame_id 00086 length = len(_x) 00087 buff.write(struct.pack('<I%ss'%length, length, _x)) 00088 length = len(self.data) 00089 buff.write(_struct_I.pack(length)) 00090 for val1 in self.data: 00091 length = len(val1.data) 00092 buff.write(_struct_I.pack(length)) 00093 for val2 in val1.data: 00094 buff.write(_struct_h.pack(val2.data)) 00095 except struct.error as se: self._check_types(se) 00096 except TypeError as te: self._check_types(te) 00097 00098 def deserialize(self, str): 00099 """ 00100 unpack serialized message in str into this message instance 00101 @param str: byte array of serialized message 00102 @type str: str 00103 """ 00104 try: 00105 if self.header is None: 00106 self.header = std_msgs.msg._Header.Header() 00107 end = 0 00108 _x = self 00109 start = end 00110 end += 12 00111 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00112 start = end 00113 end += 4 00114 (length,) = _struct_I.unpack(str[start:end]) 00115 start = end 00116 end += length 00117 self.header.frame_id = str[start:end] 00118 start = end 00119 end += 4 00120 (length,) = _struct_I.unpack(str[start:end]) 00121 self.data = [] 00122 for i in range(0, length): 00123 val1 = sr_robot_msgs.msg.Tactile() 00124 start = end 00125 end += 4 00126 (length,) = _struct_I.unpack(str[start:end]) 00127 val1.data = [] 00128 for i in range(0, length): 00129 val2 = std_msgs.msg.Int16() 00130 start = end 00131 end += 2 00132 (val2.data,) = _struct_h.unpack(str[start:end]) 00133 val1.data.append(val2) 00134 self.data.append(val1) 00135 return self 00136 except struct.error as e: 00137 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00138 00139 00140 def serialize_numpy(self, buff, numpy): 00141 """ 00142 serialize message with numpy array types into buffer 00143 @param buff: buffer 00144 @type buff: StringIO 00145 @param numpy: numpy python module 00146 @type numpy module 00147 """ 00148 try: 00149 _x = self 00150 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00151 _x = self.header.frame_id 00152 length = len(_x) 00153 buff.write(struct.pack('<I%ss'%length, length, _x)) 00154 length = len(self.data) 00155 buff.write(_struct_I.pack(length)) 00156 for val1 in self.data: 00157 length = len(val1.data) 00158 buff.write(_struct_I.pack(length)) 00159 for val2 in val1.data: 00160 buff.write(_struct_h.pack(val2.data)) 00161 except struct.error as se: self._check_types(se) 00162 except TypeError as te: self._check_types(te) 00163 00164 def deserialize_numpy(self, str, numpy): 00165 """ 00166 unpack serialized message in str into this message instance using numpy for array types 00167 @param str: byte array of serialized message 00168 @type str: str 00169 @param numpy: numpy python module 00170 @type numpy: module 00171 """ 00172 try: 00173 if self.header is None: 00174 self.header = std_msgs.msg._Header.Header() 00175 end = 0 00176 _x = self 00177 start = end 00178 end += 12 00179 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00180 start = end 00181 end += 4 00182 (length,) = _struct_I.unpack(str[start:end]) 00183 start = end 00184 end += length 00185 self.header.frame_id = str[start:end] 00186 start = end 00187 end += 4 00188 (length,) = _struct_I.unpack(str[start:end]) 00189 self.data = [] 00190 for i in range(0, length): 00191 val1 = sr_robot_msgs.msg.Tactile() 00192 start = end 00193 end += 4 00194 (length,) = _struct_I.unpack(str[start:end]) 00195 val1.data = [] 00196 for i in range(0, length): 00197 val2 = std_msgs.msg.Int16() 00198 start = end 00199 end += 2 00200 (val2.data,) = _struct_h.unpack(str[start:end]) 00201 val1.data.append(val2) 00202 self.data.append(val1) 00203 return self 00204 except struct.error as e: 00205 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00206 00207 _struct_I = roslib.message.struct_I 00208 _struct_h = struct.Struct("<h") 00209 _struct_3I = struct.Struct("<3I")