$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 pr2_controllers_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 = "aee77e81e3afb8d91af4939d603609d8" 00013 _type = "pr2_controllers_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: pr2_controllers_msgs/JointTrajectoryGoal 00054 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00055 trajectory_msgs/JointTrajectory trajectory 00056 00057 ================================================================================ 00058 MSG: trajectory_msgs/JointTrajectory 00059 Header header 00060 string[] joint_names 00061 JointTrajectoryPoint[] points 00062 ================================================================================ 00063 MSG: trajectory_msgs/JointTrajectoryPoint 00064 float64[] positions 00065 float64[] velocities 00066 float64[] accelerations 00067 duration time_from_start 00068 """ 00069 __slots__ = ['header','goal_id','goal'] 00070 _slot_types = ['Header','actionlib_msgs/GoalID','pr2_controllers_msgs/JointTrajectoryGoal'] 00071 00072 def __init__(self, *args, **kwds): 00073 """ 00074 Constructor. Any message fields that are implicitly/explicitly 00075 set to None will be assigned a default value. The recommend 00076 use is keyword arguments as this is more robust to future message 00077 changes. You cannot mix in-order arguments and keyword arguments. 00078 00079 The available fields are: 00080 header,goal_id,goal 00081 00082 @param args: complete set of field values, in .msg order 00083 @param kwds: use keyword arguments corresponding to message field names 00084 to set specific fields. 00085 """ 00086 if args or kwds: 00087 super(JointTrajectoryActionGoal, self).__init__(*args, **kwds) 00088 #message fields cannot be None, assign default values for those that are 00089 if self.header is None: 00090 self.header = std_msgs.msg._Header.Header() 00091 if self.goal_id is None: 00092 self.goal_id = actionlib_msgs.msg.GoalID() 00093 if self.goal is None: 00094 self.goal = pr2_controllers_msgs.msg.JointTrajectoryGoal() 00095 else: 00096 self.header = std_msgs.msg._Header.Header() 00097 self.goal_id = actionlib_msgs.msg.GoalID() 00098 self.goal = pr2_controllers_msgs.msg.JointTrajectoryGoal() 00099 00100 def _get_types(self): 00101 """ 00102 internal API method 00103 """ 00104 return self._slot_types 00105 00106 def serialize(self, buff): 00107 """ 00108 serialize message into buffer 00109 @param buff: buffer 00110 @type buff: StringIO 00111 """ 00112 try: 00113 _x = self 00114 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00115 _x = self.header.frame_id 00116 length = len(_x) 00117 buff.write(struct.pack('<I%ss'%length, length, _x)) 00118 _x = self 00119 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00120 _x = self.goal_id.id 00121 length = len(_x) 00122 buff.write(struct.pack('<I%ss'%length, length, _x)) 00123 _x = self 00124 buff.write(_struct_3I.pack(_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs)) 00125 _x = self.goal.trajectory.header.frame_id 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 length = len(self.goal.trajectory.joint_names) 00129 buff.write(_struct_I.pack(length)) 00130 for val1 in self.goal.trajectory.joint_names: 00131 length = len(val1) 00132 buff.write(struct.pack('<I%ss'%length, length, val1)) 00133 length = len(self.goal.trajectory.points) 00134 buff.write(_struct_I.pack(length)) 00135 for val1 in self.goal.trajectory.points: 00136 length = len(val1.positions) 00137 buff.write(_struct_I.pack(length)) 00138 pattern = '<%sd'%length 00139 buff.write(struct.pack(pattern, *val1.positions)) 00140 length = len(val1.velocities) 00141 buff.write(_struct_I.pack(length)) 00142 pattern = '<%sd'%length 00143 buff.write(struct.pack(pattern, *val1.velocities)) 00144 length = len(val1.accelerations) 00145 buff.write(_struct_I.pack(length)) 00146 pattern = '<%sd'%length 00147 buff.write(struct.pack(pattern, *val1.accelerations)) 00148 _v1 = val1.time_from_start 00149 _x = _v1 00150 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00151 except struct.error as se: self._check_types(se) 00152 except TypeError as te: self._check_types(te) 00153 00154 def deserialize(self, str): 00155 """ 00156 unpack serialized message in str into this message instance 00157 @param str: byte array of serialized message 00158 @type str: str 00159 """ 00160 try: 00161 if self.header is None: 00162 self.header = std_msgs.msg._Header.Header() 00163 if self.goal_id is None: 00164 self.goal_id = actionlib_msgs.msg.GoalID() 00165 if self.goal is None: 00166 self.goal = pr2_controllers_msgs.msg.JointTrajectoryGoal() 00167 end = 0 00168 _x = self 00169 start = end 00170 end += 12 00171 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00172 start = end 00173 end += 4 00174 (length,) = _struct_I.unpack(str[start:end]) 00175 start = end 00176 end += length 00177 self.header.frame_id = str[start:end] 00178 _x = self 00179 start = end 00180 end += 8 00181 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00182 start = end 00183 end += 4 00184 (length,) = _struct_I.unpack(str[start:end]) 00185 start = end 00186 end += length 00187 self.goal_id.id = str[start:end] 00188 _x = self 00189 start = end 00190 end += 12 00191 (_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00192 start = end 00193 end += 4 00194 (length,) = _struct_I.unpack(str[start:end]) 00195 start = end 00196 end += length 00197 self.goal.trajectory.header.frame_id = str[start:end] 00198 start = end 00199 end += 4 00200 (length,) = _struct_I.unpack(str[start:end]) 00201 self.goal.trajectory.joint_names = [] 00202 for i in range(0, length): 00203 start = end 00204 end += 4 00205 (length,) = _struct_I.unpack(str[start:end]) 00206 start = end 00207 end += length 00208 val1 = str[start:end] 00209 self.goal.trajectory.joint_names.append(val1) 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 self.goal.trajectory.points = [] 00214 for i in range(0, length): 00215 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00216 start = end 00217 end += 4 00218 (length,) = _struct_I.unpack(str[start:end]) 00219 pattern = '<%sd'%length 00220 start = end 00221 end += struct.calcsize(pattern) 00222 val1.positions = struct.unpack(pattern, str[start:end]) 00223 start = end 00224 end += 4 00225 (length,) = _struct_I.unpack(str[start:end]) 00226 pattern = '<%sd'%length 00227 start = end 00228 end += struct.calcsize(pattern) 00229 val1.velocities = struct.unpack(pattern, str[start:end]) 00230 start = end 00231 end += 4 00232 (length,) = _struct_I.unpack(str[start:end]) 00233 pattern = '<%sd'%length 00234 start = end 00235 end += struct.calcsize(pattern) 00236 val1.accelerations = struct.unpack(pattern, str[start:end]) 00237 _v2 = val1.time_from_start 00238 _x = _v2 00239 start = end 00240 end += 8 00241 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00242 self.goal.trajectory.points.append(val1) 00243 return self 00244 except struct.error as e: 00245 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00246 00247 00248 def serialize_numpy(self, buff, numpy): 00249 """ 00250 serialize message with numpy array types into buffer 00251 @param buff: buffer 00252 @type buff: StringIO 00253 @param numpy: numpy python module 00254 @type numpy module 00255 """ 00256 try: 00257 _x = self 00258 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00259 _x = self.header.frame_id 00260 length = len(_x) 00261 buff.write(struct.pack('<I%ss'%length, length, _x)) 00262 _x = self 00263 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00264 _x = self.goal_id.id 00265 length = len(_x) 00266 buff.write(struct.pack('<I%ss'%length, length, _x)) 00267 _x = self 00268 buff.write(_struct_3I.pack(_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs)) 00269 _x = self.goal.trajectory.header.frame_id 00270 length = len(_x) 00271 buff.write(struct.pack('<I%ss'%length, length, _x)) 00272 length = len(self.goal.trajectory.joint_names) 00273 buff.write(_struct_I.pack(length)) 00274 for val1 in self.goal.trajectory.joint_names: 00275 length = len(val1) 00276 buff.write(struct.pack('<I%ss'%length, length, val1)) 00277 length = len(self.goal.trajectory.points) 00278 buff.write(_struct_I.pack(length)) 00279 for val1 in self.goal.trajectory.points: 00280 length = len(val1.positions) 00281 buff.write(_struct_I.pack(length)) 00282 pattern = '<%sd'%length 00283 buff.write(val1.positions.tostring()) 00284 length = len(val1.velocities) 00285 buff.write(_struct_I.pack(length)) 00286 pattern = '<%sd'%length 00287 buff.write(val1.velocities.tostring()) 00288 length = len(val1.accelerations) 00289 buff.write(_struct_I.pack(length)) 00290 pattern = '<%sd'%length 00291 buff.write(val1.accelerations.tostring()) 00292 _v3 = val1.time_from_start 00293 _x = _v3 00294 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00295 except struct.error as se: self._check_types(se) 00296 except TypeError as te: self._check_types(te) 00297 00298 def deserialize_numpy(self, str, numpy): 00299 """ 00300 unpack serialized message in str into this message instance using numpy for array types 00301 @param str: byte array of serialized message 00302 @type str: str 00303 @param numpy: numpy python module 00304 @type numpy: module 00305 """ 00306 try: 00307 if self.header is None: 00308 self.header = std_msgs.msg._Header.Header() 00309 if self.goal_id is None: 00310 self.goal_id = actionlib_msgs.msg.GoalID() 00311 if self.goal is None: 00312 self.goal = pr2_controllers_msgs.msg.JointTrajectoryGoal() 00313 end = 0 00314 _x = self 00315 start = end 00316 end += 12 00317 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00318 start = end 00319 end += 4 00320 (length,) = _struct_I.unpack(str[start:end]) 00321 start = end 00322 end += length 00323 self.header.frame_id = str[start:end] 00324 _x = self 00325 start = end 00326 end += 8 00327 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00328 start = end 00329 end += 4 00330 (length,) = _struct_I.unpack(str[start:end]) 00331 start = end 00332 end += length 00333 self.goal_id.id = str[start:end] 00334 _x = self 00335 start = end 00336 end += 12 00337 (_x.goal.trajectory.header.seq, _x.goal.trajectory.header.stamp.secs, _x.goal.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00338 start = end 00339 end += 4 00340 (length,) = _struct_I.unpack(str[start:end]) 00341 start = end 00342 end += length 00343 self.goal.trajectory.header.frame_id = str[start:end] 00344 start = end 00345 end += 4 00346 (length,) = _struct_I.unpack(str[start:end]) 00347 self.goal.trajectory.joint_names = [] 00348 for i in range(0, length): 00349 start = end 00350 end += 4 00351 (length,) = _struct_I.unpack(str[start:end]) 00352 start = end 00353 end += length 00354 val1 = str[start:end] 00355 self.goal.trajectory.joint_names.append(val1) 00356 start = end 00357 end += 4 00358 (length,) = _struct_I.unpack(str[start:end]) 00359 self.goal.trajectory.points = [] 00360 for i in range(0, length): 00361 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00362 start = end 00363 end += 4 00364 (length,) = _struct_I.unpack(str[start:end]) 00365 pattern = '<%sd'%length 00366 start = end 00367 end += struct.calcsize(pattern) 00368 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00369 start = end 00370 end += 4 00371 (length,) = _struct_I.unpack(str[start:end]) 00372 pattern = '<%sd'%length 00373 start = end 00374 end += struct.calcsize(pattern) 00375 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00376 start = end 00377 end += 4 00378 (length,) = _struct_I.unpack(str[start:end]) 00379 pattern = '<%sd'%length 00380 start = end 00381 end += struct.calcsize(pattern) 00382 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00383 _v4 = val1.time_from_start 00384 _x = _v4 00385 start = end 00386 end += 8 00387 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00388 self.goal.trajectory.points.append(val1) 00389 return self 00390 except struct.error as e: 00391 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00392 00393 _struct_I = roslib.message.struct_I 00394 _struct_3I = struct.Struct("<3I") 00395 _struct_2I = struct.Struct("<2I") 00396 _struct_2i = struct.Struct("<2i")