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