$search
00001 """autogenerated by genmsg_py from JointAngleTrajectory.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class JointAngleTrajectory(roslib.message.Message): 00008 _md5sum = "5ec9aa90e61498421ea53db10da7f8dd" 00009 _type = "nao_msgs/JointAngleTrajectory" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """Header header 00012 00013 # A list of joint names, corresponding to their names in the Nao docs. 00014 # This must be either the same lenght of joint_angles or 1 if it's a 00015 # keyword such as 'Body' (for all angles) 00016 string[] joint_names 00017 float32[] joint_angles 00018 float32[] times 00019 00020 # Absolute angle(=0, default) or relative change 00021 uint8 relative 00022 00023 ================================================================================ 00024 MSG: std_msgs/Header 00025 # Standard metadata for higher-level stamped data types. 00026 # This is generally used to communicate timestamped data 00027 # in a particular coordinate frame. 00028 # 00029 # sequence ID: consecutively increasing ID 00030 uint32 seq 00031 #Two-integer timestamp that is expressed as: 00032 # * stamp.secs: seconds (stamp_secs) since epoch 00033 # * stamp.nsecs: nanoseconds since stamp_secs 00034 # time-handling sugar is provided by the client library 00035 time stamp 00036 #Frame this data is associated with 00037 # 0: no frame 00038 # 1: global frame 00039 string frame_id 00040 00041 """ 00042 __slots__ = ['header','joint_names','joint_angles','times','relative'] 00043 _slot_types = ['Header','string[]','float32[]','float32[]','uint8'] 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,joint_names,joint_angles,times,relative 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(JointAngleTrajectory, 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.joint_names is None: 00065 self.joint_names = [] 00066 if self.joint_angles is None: 00067 self.joint_angles = [] 00068 if self.times is None: 00069 self.times = [] 00070 if self.relative is None: 00071 self.relative = 0 00072 else: 00073 self.header = std_msgs.msg._Header.Header() 00074 self.joint_names = [] 00075 self.joint_angles = [] 00076 self.times = [] 00077 self.relative = 0 00078 00079 def _get_types(self): 00080 """ 00081 internal API method 00082 """ 00083 return self._slot_types 00084 00085 def serialize(self, buff): 00086 """ 00087 serialize message into buffer 00088 @param buff: buffer 00089 @type buff: StringIO 00090 """ 00091 try: 00092 _x = self 00093 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00094 _x = self.header.frame_id 00095 length = len(_x) 00096 buff.write(struct.pack('<I%ss'%length, length, _x)) 00097 length = len(self.joint_names) 00098 buff.write(_struct_I.pack(length)) 00099 for val1 in self.joint_names: 00100 length = len(val1) 00101 buff.write(struct.pack('<I%ss'%length, length, val1)) 00102 length = len(self.joint_angles) 00103 buff.write(_struct_I.pack(length)) 00104 pattern = '<%sf'%length 00105 buff.write(struct.pack(pattern, *self.joint_angles)) 00106 length = len(self.times) 00107 buff.write(_struct_I.pack(length)) 00108 pattern = '<%sf'%length 00109 buff.write(struct.pack(pattern, *self.times)) 00110 buff.write(_struct_B.pack(self.relative)) 00111 except struct.error as se: self._check_types(se) 00112 except TypeError as te: self._check_types(te) 00113 00114 def deserialize(self, str): 00115 """ 00116 unpack serialized message in str into this message instance 00117 @param str: byte array of serialized message 00118 @type str: str 00119 """ 00120 try: 00121 if self.header is None: 00122 self.header = std_msgs.msg._Header.Header() 00123 end = 0 00124 _x = self 00125 start = end 00126 end += 12 00127 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00128 start = end 00129 end += 4 00130 (length,) = _struct_I.unpack(str[start:end]) 00131 start = end 00132 end += length 00133 self.header.frame_id = str[start:end] 00134 start = end 00135 end += 4 00136 (length,) = _struct_I.unpack(str[start:end]) 00137 self.joint_names = [] 00138 for i in range(0, length): 00139 start = end 00140 end += 4 00141 (length,) = _struct_I.unpack(str[start:end]) 00142 start = end 00143 end += length 00144 val1 = str[start:end] 00145 self.joint_names.append(val1) 00146 start = end 00147 end += 4 00148 (length,) = _struct_I.unpack(str[start:end]) 00149 pattern = '<%sf'%length 00150 start = end 00151 end += struct.calcsize(pattern) 00152 self.joint_angles = struct.unpack(pattern, str[start:end]) 00153 start = end 00154 end += 4 00155 (length,) = _struct_I.unpack(str[start:end]) 00156 pattern = '<%sf'%length 00157 start = end 00158 end += struct.calcsize(pattern) 00159 self.times = struct.unpack(pattern, str[start:end]) 00160 start = end 00161 end += 1 00162 (self.relative,) = _struct_B.unpack(str[start:end]) 00163 return self 00164 except struct.error as e: 00165 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00166 00167 00168 def serialize_numpy(self, buff, numpy): 00169 """ 00170 serialize message with numpy array types into buffer 00171 @param buff: buffer 00172 @type buff: StringIO 00173 @param numpy: numpy python module 00174 @type numpy module 00175 """ 00176 try: 00177 _x = self 00178 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00179 _x = self.header.frame_id 00180 length = len(_x) 00181 buff.write(struct.pack('<I%ss'%length, length, _x)) 00182 length = len(self.joint_names) 00183 buff.write(_struct_I.pack(length)) 00184 for val1 in self.joint_names: 00185 length = len(val1) 00186 buff.write(struct.pack('<I%ss'%length, length, val1)) 00187 length = len(self.joint_angles) 00188 buff.write(_struct_I.pack(length)) 00189 pattern = '<%sf'%length 00190 buff.write(self.joint_angles.tostring()) 00191 length = len(self.times) 00192 buff.write(_struct_I.pack(length)) 00193 pattern = '<%sf'%length 00194 buff.write(self.times.tostring()) 00195 buff.write(_struct_B.pack(self.relative)) 00196 except struct.error as se: self._check_types(se) 00197 except TypeError as te: self._check_types(te) 00198 00199 def deserialize_numpy(self, str, numpy): 00200 """ 00201 unpack serialized message in str into this message instance using numpy for array types 00202 @param str: byte array of serialized message 00203 @type str: str 00204 @param numpy: numpy python module 00205 @type numpy: module 00206 """ 00207 try: 00208 if self.header is None: 00209 self.header = std_msgs.msg._Header.Header() 00210 end = 0 00211 _x = self 00212 start = end 00213 end += 12 00214 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00215 start = end 00216 end += 4 00217 (length,) = _struct_I.unpack(str[start:end]) 00218 start = end 00219 end += length 00220 self.header.frame_id = str[start:end] 00221 start = end 00222 end += 4 00223 (length,) = _struct_I.unpack(str[start:end]) 00224 self.joint_names = [] 00225 for i in range(0, length): 00226 start = end 00227 end += 4 00228 (length,) = _struct_I.unpack(str[start:end]) 00229 start = end 00230 end += length 00231 val1 = str[start:end] 00232 self.joint_names.append(val1) 00233 start = end 00234 end += 4 00235 (length,) = _struct_I.unpack(str[start:end]) 00236 pattern = '<%sf'%length 00237 start = end 00238 end += struct.calcsize(pattern) 00239 self.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00240 start = end 00241 end += 4 00242 (length,) = _struct_I.unpack(str[start:end]) 00243 pattern = '<%sf'%length 00244 start = end 00245 end += struct.calcsize(pattern) 00246 self.times = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00247 start = end 00248 end += 1 00249 (self.relative,) = _struct_B.unpack(str[start:end]) 00250 return self 00251 except struct.error as e: 00252 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00253 00254 _struct_I = roslib.message.struct_I 00255 _struct_3I = struct.Struct("<3I") 00256 _struct_B = struct.Struct("<B")