00001 """autogenerated by genmsg_py from RobotTrajectory.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import trajectory_msgs.msg
00006 import motion_planning_msgs.msg
00007 import geometry_msgs.msg
00008 import roslib.rostime
00009 import std_msgs.msg
00010
00011 class RobotTrajectory(roslib.message.Message):
00012 _md5sum = "5bc8324620001e5c07a09d0bbfaaf093"
00013 _type = "motion_planning_msgs/RobotTrajectory"
00014 _has_header = False
00015 _full_text = """trajectory_msgs/JointTrajectory joint_trajectory
00016 motion_planning_msgs/MultiDOFJointTrajectory multi_dof_joint_trajectory
00017 ================================================================================
00018 MSG: trajectory_msgs/JointTrajectory
00019 Header header
00020 string[] joint_names
00021 JointTrajectoryPoint[] points
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: trajectory_msgs/JointTrajectoryPoint
00042 float64[] positions
00043 float64[] velocities
00044 float64[] accelerations
00045 duration time_from_start
00046 ================================================================================
00047 MSG: motion_planning_msgs/MultiDOFJointTrajectory
00048 #A representation of a multi-dof joint trajectory
00049 duration stamp
00050 string[] joint_names
00051 string[] frame_ids
00052 string[] child_frame_ids
00053 MultiDOFJointTrajectoryPoint[] points
00054
00055 ================================================================================
00056 MSG: motion_planning_msgs/MultiDOFJointTrajectoryPoint
00057 geometry_msgs/Pose[] poses
00058 duration time_from_start
00059 ================================================================================
00060 MSG: geometry_msgs/Pose
00061 # A representation of pose in free space, composed of postion and orientation.
00062 Point position
00063 Quaternion orientation
00064
00065 ================================================================================
00066 MSG: geometry_msgs/Point
00067 # This contains the position of a point in free space
00068 float64 x
00069 float64 y
00070 float64 z
00071
00072 ================================================================================
00073 MSG: geometry_msgs/Quaternion
00074 # This represents an orientation in free space in quaternion form.
00075
00076 float64 x
00077 float64 y
00078 float64 z
00079 float64 w
00080
00081 """
00082 __slots__ = ['joint_trajectory','multi_dof_joint_trajectory']
00083 _slot_types = ['trajectory_msgs/JointTrajectory','motion_planning_msgs/MultiDOFJointTrajectory']
00084
00085 def __init__(self, *args, **kwds):
00086 """
00087 Constructor. Any message fields that are implicitly/explicitly
00088 set to None will be assigned a default value. The recommend
00089 use is keyword arguments as this is more robust to future message
00090 changes. You cannot mix in-order arguments and keyword arguments.
00091
00092 The available fields are:
00093 joint_trajectory,multi_dof_joint_trajectory
00094
00095 @param args: complete set of field values, in .msg order
00096 @param kwds: use keyword arguments corresponding to message field names
00097 to set specific fields.
00098 """
00099 if args or kwds:
00100 super(RobotTrajectory, self).__init__(*args, **kwds)
00101
00102 if self.joint_trajectory is None:
00103 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory()
00104 if self.multi_dof_joint_trajectory is None:
00105 self.multi_dof_joint_trajectory = motion_planning_msgs.msg.MultiDOFJointTrajectory()
00106 else:
00107 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory()
00108 self.multi_dof_joint_trajectory = motion_planning_msgs.msg.MultiDOFJointTrajectory()
00109
00110 def _get_types(self):
00111 """
00112 internal API method
00113 """
00114 return self._slot_types
00115
00116 def serialize(self, buff):
00117 """
00118 serialize message into buffer
00119 @param buff: buffer
00120 @type buff: StringIO
00121 """
00122 try:
00123 _x = self
00124 buff.write(_struct_3I.pack(_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs))
00125 _x = self.joint_trajectory.header.frame_id
00126 length = len(_x)
00127 buff.write(struct.pack('<I%ss'%length, length, _x))
00128 length = len(self.joint_trajectory.joint_names)
00129 buff.write(_struct_I.pack(length))
00130 for val1 in self.joint_trajectory.joint_names:
00131 length = len(val1)
00132 buff.write(struct.pack('<I%ss'%length, length, val1))
00133 length = len(self.joint_trajectory.points)
00134 buff.write(_struct_I.pack(length))
00135 for val1 in self.joint_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 _x = self
00152 buff.write(_struct_2i.pack(_x.multi_dof_joint_trajectory.stamp.secs, _x.multi_dof_joint_trajectory.stamp.nsecs))
00153 length = len(self.multi_dof_joint_trajectory.joint_names)
00154 buff.write(_struct_I.pack(length))
00155 for val1 in self.multi_dof_joint_trajectory.joint_names:
00156 length = len(val1)
00157 buff.write(struct.pack('<I%ss'%length, length, val1))
00158 length = len(self.multi_dof_joint_trajectory.frame_ids)
00159 buff.write(_struct_I.pack(length))
00160 for val1 in self.multi_dof_joint_trajectory.frame_ids:
00161 length = len(val1)
00162 buff.write(struct.pack('<I%ss'%length, length, val1))
00163 length = len(self.multi_dof_joint_trajectory.child_frame_ids)
00164 buff.write(_struct_I.pack(length))
00165 for val1 in self.multi_dof_joint_trajectory.child_frame_ids:
00166 length = len(val1)
00167 buff.write(struct.pack('<I%ss'%length, length, val1))
00168 length = len(self.multi_dof_joint_trajectory.points)
00169 buff.write(_struct_I.pack(length))
00170 for val1 in self.multi_dof_joint_trajectory.points:
00171 length = len(val1.poses)
00172 buff.write(_struct_I.pack(length))
00173 for val2 in val1.poses:
00174 _v2 = val2.position
00175 _x = _v2
00176 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00177 _v3 = val2.orientation
00178 _x = _v3
00179 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00180 _v4 = val1.time_from_start
00181 _x = _v4
00182 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00183 except struct.error, se: self._check_types(se)
00184 except TypeError, te: self._check_types(te)
00185
00186 def deserialize(self, str):
00187 """
00188 unpack serialized message in str into this message instance
00189 @param str: byte array of serialized message
00190 @type str: str
00191 """
00192 try:
00193 if self.joint_trajectory is None:
00194 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory()
00195 if self.multi_dof_joint_trajectory is None:
00196 self.multi_dof_joint_trajectory = motion_planning_msgs.msg.MultiDOFJointTrajectory()
00197 end = 0
00198 _x = self
00199 start = end
00200 end += 12
00201 (_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 start = end
00206 end += length
00207 self.joint_trajectory.header.frame_id = str[start:end]
00208 start = end
00209 end += 4
00210 (length,) = _struct_I.unpack(str[start:end])
00211 self.joint_trajectory.joint_names = []
00212 for i in xrange(0, length):
00213 start = end
00214 end += 4
00215 (length,) = _struct_I.unpack(str[start:end])
00216 start = end
00217 end += length
00218 val1 = str[start:end]
00219 self.joint_trajectory.joint_names.append(val1)
00220 start = end
00221 end += 4
00222 (length,) = _struct_I.unpack(str[start:end])
00223 self.joint_trajectory.points = []
00224 for i in xrange(0, length):
00225 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 pattern = '<%sd'%length
00230 start = end
00231 end += struct.calcsize(pattern)
00232 val1.positions = struct.unpack(pattern, str[start:end])
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 pattern = '<%sd'%length
00237 start = end
00238 end += struct.calcsize(pattern)
00239 val1.velocities = struct.unpack(pattern, str[start:end])
00240 start = end
00241 end += 4
00242 (length,) = _struct_I.unpack(str[start:end])
00243 pattern = '<%sd'%length
00244 start = end
00245 end += struct.calcsize(pattern)
00246 val1.accelerations = struct.unpack(pattern, str[start:end])
00247 _v5 = val1.time_from_start
00248 _x = _v5
00249 start = end
00250 end += 8
00251 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00252 self.joint_trajectory.points.append(val1)
00253 _x = self
00254 start = end
00255 end += 8
00256 (_x.multi_dof_joint_trajectory.stamp.secs, _x.multi_dof_joint_trajectory.stamp.nsecs,) = _struct_2i.unpack(str[start:end])
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 self.multi_dof_joint_trajectory.joint_names = []
00261 for i in xrange(0, length):
00262 start = end
00263 end += 4
00264 (length,) = _struct_I.unpack(str[start:end])
00265 start = end
00266 end += length
00267 val1 = str[start:end]
00268 self.multi_dof_joint_trajectory.joint_names.append(val1)
00269 start = end
00270 end += 4
00271 (length,) = _struct_I.unpack(str[start:end])
00272 self.multi_dof_joint_trajectory.frame_ids = []
00273 for i in xrange(0, length):
00274 start = end
00275 end += 4
00276 (length,) = _struct_I.unpack(str[start:end])
00277 start = end
00278 end += length
00279 val1 = str[start:end]
00280 self.multi_dof_joint_trajectory.frame_ids.append(val1)
00281 start = end
00282 end += 4
00283 (length,) = _struct_I.unpack(str[start:end])
00284 self.multi_dof_joint_trajectory.child_frame_ids = []
00285 for i in xrange(0, length):
00286 start = end
00287 end += 4
00288 (length,) = _struct_I.unpack(str[start:end])
00289 start = end
00290 end += length
00291 val1 = str[start:end]
00292 self.multi_dof_joint_trajectory.child_frame_ids.append(val1)
00293 start = end
00294 end += 4
00295 (length,) = _struct_I.unpack(str[start:end])
00296 self.multi_dof_joint_trajectory.points = []
00297 for i in xrange(0, length):
00298 val1 = motion_planning_msgs.msg.MultiDOFJointTrajectoryPoint()
00299 start = end
00300 end += 4
00301 (length,) = _struct_I.unpack(str[start:end])
00302 val1.poses = []
00303 for i in xrange(0, length):
00304 val2 = geometry_msgs.msg.Pose()
00305 _v6 = val2.position
00306 _x = _v6
00307 start = end
00308 end += 24
00309 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00310 _v7 = val2.orientation
00311 _x = _v7
00312 start = end
00313 end += 32
00314 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00315 val1.poses.append(val2)
00316 _v8 = val1.time_from_start
00317 _x = _v8
00318 start = end
00319 end += 8
00320 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00321 self.multi_dof_joint_trajectory.points.append(val1)
00322 return self
00323 except struct.error, e:
00324 raise roslib.message.DeserializationError(e)
00325
00326
00327 def serialize_numpy(self, buff, numpy):
00328 """
00329 serialize message with numpy array types into buffer
00330 @param buff: buffer
00331 @type buff: StringIO
00332 @param numpy: numpy python module
00333 @type numpy module
00334 """
00335 try:
00336 _x = self
00337 buff.write(_struct_3I.pack(_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs))
00338 _x = self.joint_trajectory.header.frame_id
00339 length = len(_x)
00340 buff.write(struct.pack('<I%ss'%length, length, _x))
00341 length = len(self.joint_trajectory.joint_names)
00342 buff.write(_struct_I.pack(length))
00343 for val1 in self.joint_trajectory.joint_names:
00344 length = len(val1)
00345 buff.write(struct.pack('<I%ss'%length, length, val1))
00346 length = len(self.joint_trajectory.points)
00347 buff.write(_struct_I.pack(length))
00348 for val1 in self.joint_trajectory.points:
00349 length = len(val1.positions)
00350 buff.write(_struct_I.pack(length))
00351 pattern = '<%sd'%length
00352 buff.write(val1.positions.tostring())
00353 length = len(val1.velocities)
00354 buff.write(_struct_I.pack(length))
00355 pattern = '<%sd'%length
00356 buff.write(val1.velocities.tostring())
00357 length = len(val1.accelerations)
00358 buff.write(_struct_I.pack(length))
00359 pattern = '<%sd'%length
00360 buff.write(val1.accelerations.tostring())
00361 _v9 = val1.time_from_start
00362 _x = _v9
00363 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00364 _x = self
00365 buff.write(_struct_2i.pack(_x.multi_dof_joint_trajectory.stamp.secs, _x.multi_dof_joint_trajectory.stamp.nsecs))
00366 length = len(self.multi_dof_joint_trajectory.joint_names)
00367 buff.write(_struct_I.pack(length))
00368 for val1 in self.multi_dof_joint_trajectory.joint_names:
00369 length = len(val1)
00370 buff.write(struct.pack('<I%ss'%length, length, val1))
00371 length = len(self.multi_dof_joint_trajectory.frame_ids)
00372 buff.write(_struct_I.pack(length))
00373 for val1 in self.multi_dof_joint_trajectory.frame_ids:
00374 length = len(val1)
00375 buff.write(struct.pack('<I%ss'%length, length, val1))
00376 length = len(self.multi_dof_joint_trajectory.child_frame_ids)
00377 buff.write(_struct_I.pack(length))
00378 for val1 in self.multi_dof_joint_trajectory.child_frame_ids:
00379 length = len(val1)
00380 buff.write(struct.pack('<I%ss'%length, length, val1))
00381 length = len(self.multi_dof_joint_trajectory.points)
00382 buff.write(_struct_I.pack(length))
00383 for val1 in self.multi_dof_joint_trajectory.points:
00384 length = len(val1.poses)
00385 buff.write(_struct_I.pack(length))
00386 for val2 in val1.poses:
00387 _v10 = val2.position
00388 _x = _v10
00389 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00390 _v11 = val2.orientation
00391 _x = _v11
00392 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00393 _v12 = val1.time_from_start
00394 _x = _v12
00395 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00396 except struct.error, se: self._check_types(se)
00397 except TypeError, te: self._check_types(te)
00398
00399 def deserialize_numpy(self, str, numpy):
00400 """
00401 unpack serialized message in str into this message instance using numpy for array types
00402 @param str: byte array of serialized message
00403 @type str: str
00404 @param numpy: numpy python module
00405 @type numpy: module
00406 """
00407 try:
00408 if self.joint_trajectory is None:
00409 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory()
00410 if self.multi_dof_joint_trajectory is None:
00411 self.multi_dof_joint_trajectory = motion_planning_msgs.msg.MultiDOFJointTrajectory()
00412 end = 0
00413 _x = self
00414 start = end
00415 end += 12
00416 (_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00417 start = end
00418 end += 4
00419 (length,) = _struct_I.unpack(str[start:end])
00420 start = end
00421 end += length
00422 self.joint_trajectory.header.frame_id = str[start:end]
00423 start = end
00424 end += 4
00425 (length,) = _struct_I.unpack(str[start:end])
00426 self.joint_trajectory.joint_names = []
00427 for i in xrange(0, length):
00428 start = end
00429 end += 4
00430 (length,) = _struct_I.unpack(str[start:end])
00431 start = end
00432 end += length
00433 val1 = str[start:end]
00434 self.joint_trajectory.joint_names.append(val1)
00435 start = end
00436 end += 4
00437 (length,) = _struct_I.unpack(str[start:end])
00438 self.joint_trajectory.points = []
00439 for i in xrange(0, length):
00440 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00441 start = end
00442 end += 4
00443 (length,) = _struct_I.unpack(str[start:end])
00444 pattern = '<%sd'%length
00445 start = end
00446 end += struct.calcsize(pattern)
00447 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00448 start = end
00449 end += 4
00450 (length,) = _struct_I.unpack(str[start:end])
00451 pattern = '<%sd'%length
00452 start = end
00453 end += struct.calcsize(pattern)
00454 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00455 start = end
00456 end += 4
00457 (length,) = _struct_I.unpack(str[start:end])
00458 pattern = '<%sd'%length
00459 start = end
00460 end += struct.calcsize(pattern)
00461 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00462 _v13 = val1.time_from_start
00463 _x = _v13
00464 start = end
00465 end += 8
00466 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00467 self.joint_trajectory.points.append(val1)
00468 _x = self
00469 start = end
00470 end += 8
00471 (_x.multi_dof_joint_trajectory.stamp.secs, _x.multi_dof_joint_trajectory.stamp.nsecs,) = _struct_2i.unpack(str[start:end])
00472 start = end
00473 end += 4
00474 (length,) = _struct_I.unpack(str[start:end])
00475 self.multi_dof_joint_trajectory.joint_names = []
00476 for i in xrange(0, length):
00477 start = end
00478 end += 4
00479 (length,) = _struct_I.unpack(str[start:end])
00480 start = end
00481 end += length
00482 val1 = str[start:end]
00483 self.multi_dof_joint_trajectory.joint_names.append(val1)
00484 start = end
00485 end += 4
00486 (length,) = _struct_I.unpack(str[start:end])
00487 self.multi_dof_joint_trajectory.frame_ids = []
00488 for i in xrange(0, length):
00489 start = end
00490 end += 4
00491 (length,) = _struct_I.unpack(str[start:end])
00492 start = end
00493 end += length
00494 val1 = str[start:end]
00495 self.multi_dof_joint_trajectory.frame_ids.append(val1)
00496 start = end
00497 end += 4
00498 (length,) = _struct_I.unpack(str[start:end])
00499 self.multi_dof_joint_trajectory.child_frame_ids = []
00500 for i in xrange(0, length):
00501 start = end
00502 end += 4
00503 (length,) = _struct_I.unpack(str[start:end])
00504 start = end
00505 end += length
00506 val1 = str[start:end]
00507 self.multi_dof_joint_trajectory.child_frame_ids.append(val1)
00508 start = end
00509 end += 4
00510 (length,) = _struct_I.unpack(str[start:end])
00511 self.multi_dof_joint_trajectory.points = []
00512 for i in xrange(0, length):
00513 val1 = motion_planning_msgs.msg.MultiDOFJointTrajectoryPoint()
00514 start = end
00515 end += 4
00516 (length,) = _struct_I.unpack(str[start:end])
00517 val1.poses = []
00518 for i in xrange(0, length):
00519 val2 = geometry_msgs.msg.Pose()
00520 _v14 = val2.position
00521 _x = _v14
00522 start = end
00523 end += 24
00524 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00525 _v15 = val2.orientation
00526 _x = _v15
00527 start = end
00528 end += 32
00529 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00530 val1.poses.append(val2)
00531 _v16 = val1.time_from_start
00532 _x = _v16
00533 start = end
00534 end += 8
00535 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00536 self.multi_dof_joint_trajectory.points.append(val1)
00537 return self
00538 except struct.error, e:
00539 raise roslib.message.DeserializationError(e)
00540
00541 _struct_I = roslib.message.struct_I
00542 _struct_4d = struct.Struct("<4d")
00543 _struct_3I = struct.Struct("<3I")
00544 _struct_2i = struct.Struct("<2i")
00545 _struct_3d = struct.Struct("<3d")