$search
00001 """autogenerated by genmsg_py from JointTrajectoryActionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import trajectory_msgs.msg 00006 import nao_msgs.msg 00007 import roslib.rostime 00008 import actionlib_msgs.msg 00009 import std_msgs.msg 00010 00011 class JointTrajectoryActionGoal(roslib.message.Message): 00012 _md5sum = "3273243339f8ad806de69e2c87c1e17c" 00013 _type = "nao_msgs/JointTrajectoryActionGoal" 00014 _has_header = True #flag to mark the presence of a Header object 00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00016 00017 Header header 00018 actionlib_msgs/GoalID goal_id 00019 JointTrajectoryGoal goal 00020 00021 ================================================================================ 00022 MSG: std_msgs/Header 00023 # Standard metadata for higher-level stamped data types. 00024 # This is generally used to communicate timestamped data 00025 # in a particular coordinate frame. 00026 # 00027 # sequence ID: consecutively increasing ID 00028 uint32 seq 00029 #Two-integer timestamp that is expressed as: 00030 # * stamp.secs: seconds (stamp_secs) since epoch 00031 # * stamp.nsecs: nanoseconds since stamp_secs 00032 # time-handling sugar is provided by the client library 00033 time stamp 00034 #Frame this data is associated with 00035 # 0: no frame 00036 # 1: global frame 00037 string frame_id 00038 00039 ================================================================================ 00040 MSG: actionlib_msgs/GoalID 00041 # The stamp should store the time at which this goal was requested. 00042 # It is used by an action server when it tries to preempt all 00043 # goals that were requested before a certain time 00044 time stamp 00045 00046 # The id provides a way to associate feedback and 00047 # result message with specific goal requests. The id 00048 # specified must be unique. 00049 string id 00050 00051 00052 ================================================================================ 00053 MSG: nao_msgs/JointTrajectoryGoal 00054 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00055 # goal: a joint angle trajectory 00056 trajectory_msgs/JointTrajectory trajectory 00057 # flag whether motion is absolute (=0, default) or relative (=1) 00058 uint8 relative 00059 00060 ================================================================================ 00061 MSG: trajectory_msgs/JointTrajectory 00062 Header header 00063 string[] joint_names 00064 JointTrajectoryPoint[] points 00065 ================================================================================ 00066 MSG: trajectory_msgs/JointTrajectoryPoint 00067 float64[] positions 00068 float64[] velocities 00069 float64[] accelerations 00070 duration time_from_start 00071 """ 00072 __slots__ = ['header','goal_id','goal'] 00073 _slot_types = ['Header','actionlib_msgs/GoalID','nao_msgs/JointTrajectoryGoal'] 00074 00075 def __init__(self, *args, **kwds): 00076 """ 00077 Constructor. Any message fields that are implicitly/explicitly 00078 set to None will be assigned a default value. The recommend 00079 use is keyword arguments as this is more robust to future message 00080 changes. You cannot mix in-order arguments and keyword arguments. 00081 00082 The available fields are: 00083 header,goal_id,goal 00084 00085 @param args: complete set of field values, in .msg order 00086 @param kwds: use keyword arguments corresponding to message field names 00087 to set specific fields. 00088 """ 00089 if args or kwds: 00090 super(JointTrajectoryActionGoal, self).__init__(*args, **kwds) 00091 #message fields cannot be None, assign default values for those that are 00092 if self.header is None: 00093 self.header = std_msgs.msg._Header.Header() 00094 if self.goal_id is None: 00095 self.goal_id = actionlib_msgs.msg.GoalID() 00096 if self.goal is None: 00097 self.goal = nao_msgs.msg.JointTrajectoryGoal() 00098 else: 00099 self.header = std_msgs.msg._Header.Header() 00100 self.goal_id = actionlib_msgs.msg.GoalID() 00101 self.goal = nao_msgs.msg.JointTrajectoryGoal() 00102 00103 def _get_types(self): 00104 """ 00105 internal API method 00106 """ 00107 return self._slot_types 00108 00109 def serialize(self, buff): 00110 """ 00111 serialize message into buffer 00112 @param buff: buffer 00113 @type buff: StringIO 00114 """ 00115 try: 00116 _x = self 00117 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00118 _x = self.header.frame_id 00119 length = len(_x) 00120 buff.write(struct.pack('<I%ss'%length, length, _x)) 00121 _x = self 00122 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00123 _x = self.goal_id.id 00124 length = len(_x) 00125 buff.write(struct.pack('<I%ss'%length, length, _x)) 00126 _x = self 00127 buff.write(_struct_3I.pack(_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs)) 00128 _x = self.goal.trajectory.header.frame_id 00129 length = len(_x) 00130 buff.write(struct.pack('<I%ss'%length, length, _x)) 00131 length = len(self.goal.trajectory.joint_names) 00132 buff.write(_struct_I.pack(length)) 00133 for val1 in self.goal.trajectory.joint_names: 00134 length = len(val1) 00135 buff.write(struct.pack('<I%ss'%length, length, val1)) 00136 length = len(self.goal.trajectory.points) 00137 buff.write(_struct_I.pack(length)) 00138 for val1 in self.goal.trajectory.points: 00139 length = len(val1.positions) 00140 buff.write(_struct_I.pack(length)) 00141 pattern = '<%sd'%length 00142 buff.write(struct.pack(pattern, *val1.positions)) 00143 length = len(val1.velocities) 00144 buff.write(_struct_I.pack(length)) 00145 pattern = '<%sd'%length 00146 buff.write(struct.pack(pattern, *val1.velocities)) 00147 length = len(val1.accelerations) 00148 buff.write(_struct_I.pack(length)) 00149 pattern = '<%sd'%length 00150 buff.write(struct.pack(pattern, *val1.accelerations)) 00151 _v1 = val1.time_from_start 00152 _x = _v1 00153 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00154 buff.write(_struct_B.pack(self.goal.relative)) 00155 except struct.error as se: self._check_types(se) 00156 except TypeError as te: self._check_types(te) 00157 00158 def deserialize(self, str): 00159 """ 00160 unpack serialized message in str into this message instance 00161 @param str: byte array of serialized message 00162 @type str: str 00163 """ 00164 try: 00165 if self.header is None: 00166 self.header = std_msgs.msg._Header.Header() 00167 if self.goal_id is None: 00168 self.goal_id = actionlib_msgs.msg.GoalID() 00169 if self.goal is None: 00170 self.goal = nao_msgs.msg.JointTrajectoryGoal() 00171 end = 0 00172 _x = self 00173 start = end 00174 end += 12 00175 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00176 start = end 00177 end += 4 00178 (length,) = _struct_I.unpack(str[start:end]) 00179 start = end 00180 end += length 00181 self.header.frame_id = str[start:end] 00182 _x = self 00183 start = end 00184 end += 8 00185 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00186 start = end 00187 end += 4 00188 (length,) = _struct_I.unpack(str[start:end]) 00189 start = end 00190 end += length 00191 self.goal_id.id = str[start:end] 00192 _x = self 00193 start = end 00194 end += 12 00195 (_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00196 start = end 00197 end += 4 00198 (length,) = _struct_I.unpack(str[start:end]) 00199 start = end 00200 end += length 00201 self.goal.trajectory.header.frame_id = str[start:end] 00202 start = end 00203 end += 4 00204 (length,) = _struct_I.unpack(str[start:end]) 00205 self.goal.trajectory.joint_names = [] 00206 for i in range(0, length): 00207 start = end 00208 end += 4 00209 (length,) = _struct_I.unpack(str[start:end]) 00210 start = end 00211 end += length 00212 val1 = str[start:end] 00213 self.goal.trajectory.joint_names.append(val1) 00214 start = end 00215 end += 4 00216 (length,) = _struct_I.unpack(str[start:end]) 00217 self.goal.trajectory.points = [] 00218 for i in range(0, length): 00219 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00220 start = end 00221 end += 4 00222 (length,) = _struct_I.unpack(str[start:end]) 00223 pattern = '<%sd'%length 00224 start = end 00225 end += struct.calcsize(pattern) 00226 val1.positions = struct.unpack(pattern, str[start:end]) 00227 start = end 00228 end += 4 00229 (length,) = _struct_I.unpack(str[start:end]) 00230 pattern = '<%sd'%length 00231 start = end 00232 end += struct.calcsize(pattern) 00233 val1.velocities = struct.unpack(pattern, str[start:end]) 00234 start = end 00235 end += 4 00236 (length,) = _struct_I.unpack(str[start:end]) 00237 pattern = '<%sd'%length 00238 start = end 00239 end += struct.calcsize(pattern) 00240 val1.accelerations = struct.unpack(pattern, str[start:end]) 00241 _v2 = val1.time_from_start 00242 _x = _v2 00243 start = end 00244 end += 8 00245 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00246 self.goal.trajectory.points.append(val1) 00247 start = end 00248 end += 1 00249 (self.goal.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 00255 def serialize_numpy(self, buff, numpy): 00256 """ 00257 serialize message with numpy array types into buffer 00258 @param buff: buffer 00259 @type buff: StringIO 00260 @param numpy: numpy python module 00261 @type numpy module 00262 """ 00263 try: 00264 _x = self 00265 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00266 _x = self.header.frame_id 00267 length = len(_x) 00268 buff.write(struct.pack('<I%ss'%length, length, _x)) 00269 _x = self 00270 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00271 _x = self.goal_id.id 00272 length = len(_x) 00273 buff.write(struct.pack('<I%ss'%length, length, _x)) 00274 _x = self 00275 buff.write(_struct_3I.pack(_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs)) 00276 _x = self.goal.trajectory.header.frame_id 00277 length = len(_x) 00278 buff.write(struct.pack('<I%ss'%length, length, _x)) 00279 length = len(self.goal.trajectory.joint_names) 00280 buff.write(_struct_I.pack(length)) 00281 for val1 in self.goal.trajectory.joint_names: 00282 length = len(val1) 00283 buff.write(struct.pack('<I%ss'%length, length, val1)) 00284 length = len(self.goal.trajectory.points) 00285 buff.write(_struct_I.pack(length)) 00286 for val1 in self.goal.trajectory.points: 00287 length = len(val1.positions) 00288 buff.write(_struct_I.pack(length)) 00289 pattern = '<%sd'%length 00290 buff.write(val1.positions.tostring()) 00291 length = len(val1.velocities) 00292 buff.write(_struct_I.pack(length)) 00293 pattern = '<%sd'%length 00294 buff.write(val1.velocities.tostring()) 00295 length = len(val1.accelerations) 00296 buff.write(_struct_I.pack(length)) 00297 pattern = '<%sd'%length 00298 buff.write(val1.accelerations.tostring()) 00299 _v3 = val1.time_from_start 00300 _x = _v3 00301 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00302 buff.write(_struct_B.pack(self.goal.relative)) 00303 except struct.error as se: self._check_types(se) 00304 except TypeError as te: self._check_types(te) 00305 00306 def deserialize_numpy(self, str, numpy): 00307 """ 00308 unpack serialized message in str into this message instance using numpy for array types 00309 @param str: byte array of serialized message 00310 @type str: str 00311 @param numpy: numpy python module 00312 @type numpy: module 00313 """ 00314 try: 00315 if self.header is None: 00316 self.header = std_msgs.msg._Header.Header() 00317 if self.goal_id is None: 00318 self.goal_id = actionlib_msgs.msg.GoalID() 00319 if self.goal is None: 00320 self.goal = nao_msgs.msg.JointTrajectoryGoal() 00321 end = 0 00322 _x = self 00323 start = end 00324 end += 12 00325 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00326 start = end 00327 end += 4 00328 (length,) = _struct_I.unpack(str[start:end]) 00329 start = end 00330 end += length 00331 self.header.frame_id = str[start:end] 00332 _x = self 00333 start = end 00334 end += 8 00335 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00336 start = end 00337 end += 4 00338 (length,) = _struct_I.unpack(str[start:end]) 00339 start = end 00340 end += length 00341 self.goal_id.id = str[start:end] 00342 _x = self 00343 start = end 00344 end += 12 00345 (_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00346 start = end 00347 end += 4 00348 (length,) = _struct_I.unpack(str[start:end]) 00349 start = end 00350 end += length 00351 self.goal.trajectory.header.frame_id = str[start:end] 00352 start = end 00353 end += 4 00354 (length,) = _struct_I.unpack(str[start:end]) 00355 self.goal.trajectory.joint_names = [] 00356 for i in range(0, length): 00357 start = end 00358 end += 4 00359 (length,) = _struct_I.unpack(str[start:end]) 00360 start = end 00361 end += length 00362 val1 = str[start:end] 00363 self.goal.trajectory.joint_names.append(val1) 00364 start = end 00365 end += 4 00366 (length,) = _struct_I.unpack(str[start:end]) 00367 self.goal.trajectory.points = [] 00368 for i in range(0, length): 00369 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00370 start = end 00371 end += 4 00372 (length,) = _struct_I.unpack(str[start:end]) 00373 pattern = '<%sd'%length 00374 start = end 00375 end += struct.calcsize(pattern) 00376 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00377 start = end 00378 end += 4 00379 (length,) = _struct_I.unpack(str[start:end]) 00380 pattern = '<%sd'%length 00381 start = end 00382 end += struct.calcsize(pattern) 00383 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00384 start = end 00385 end += 4 00386 (length,) = _struct_I.unpack(str[start:end]) 00387 pattern = '<%sd'%length 00388 start = end 00389 end += struct.calcsize(pattern) 00390 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00391 _v4 = val1.time_from_start 00392 _x = _v4 00393 start = end 00394 end += 8 00395 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00396 self.goal.trajectory.points.append(val1) 00397 start = end 00398 end += 1 00399 (self.goal.relative,) = _struct_B.unpack(str[start:end]) 00400 return self 00401 except struct.error as e: 00402 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00403 00404 _struct_I = roslib.message.struct_I 00405 _struct_3I = struct.Struct("<3I") 00406 _struct_B = struct.Struct("<B") 00407 _struct_2I = struct.Struct("<2I") 00408 _struct_2i = struct.Struct("<2i")