00001 """autogenerated by genmsg_py from JointTrajectoryGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import trajectory_msgs.msg
00006 import roslib.rostime
00007 import std_msgs.msg
00008
00009 class JointTrajectoryGoal(roslib.message.Message):
00010 _md5sum = "48a668811b715b51af6b3383511ae27f"
00011 _type = "pr2_controllers_msgs/JointTrajectoryGoal"
00012 _has_header = False
00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 trajectory_msgs/JointTrajectory trajectory
00015
00016 ================================================================================
00017 MSG: trajectory_msgs/JointTrajectory
00018 Header header
00019 string[] joint_names
00020 JointTrajectoryPoint[] points
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: trajectory_msgs/JointTrajectoryPoint
00041 float64[] positions
00042 float64[] velocities
00043 float64[] accelerations
00044 duration time_from_start
00045 """
00046 __slots__ = ['trajectory']
00047 _slot_types = ['trajectory_msgs/JointTrajectory']
00048
00049 def __init__(self, *args, **kwds):
00050 """
00051 Constructor. Any message fields that are implicitly/explicitly
00052 set to None will be assigned a default value. The recommend
00053 use is keyword arguments as this is more robust to future message
00054 changes. You cannot mix in-order arguments and keyword arguments.
00055
00056 The available fields are:
00057 trajectory
00058
00059 @param args: complete set of field values, in .msg order
00060 @param kwds: use keyword arguments corresponding to message field names
00061 to set specific fields.
00062 """
00063 if args or kwds:
00064 super(JointTrajectoryGoal, self).__init__(*args, **kwds)
00065
00066 if self.trajectory is None:
00067 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00068 else:
00069 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00070
00071 def _get_types(self):
00072 """
00073 internal API method
00074 """
00075 return self._slot_types
00076
00077 def serialize(self, buff):
00078 """
00079 serialize message into buffer
00080 @param buff: buffer
00081 @type buff: StringIO
00082 """
00083 try:
00084 _x = self
00085 buff.write(_struct_3I.pack(_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs))
00086 _x = self.trajectory.header.frame_id
00087 length = len(_x)
00088 buff.write(struct.pack('<I%ss'%length, length, _x))
00089 length = len(self.trajectory.joint_names)
00090 buff.write(_struct_I.pack(length))
00091 for val1 in self.trajectory.joint_names:
00092 length = len(val1)
00093 buff.write(struct.pack('<I%ss'%length, length, val1))
00094 length = len(self.trajectory.points)
00095 buff.write(_struct_I.pack(length))
00096 for val1 in self.trajectory.points:
00097 length = len(val1.positions)
00098 buff.write(_struct_I.pack(length))
00099 pattern = '<%sd'%length
00100 buff.write(struct.pack(pattern, *val1.positions))
00101 length = len(val1.velocities)
00102 buff.write(_struct_I.pack(length))
00103 pattern = '<%sd'%length
00104 buff.write(struct.pack(pattern, *val1.velocities))
00105 length = len(val1.accelerations)
00106 buff.write(_struct_I.pack(length))
00107 pattern = '<%sd'%length
00108 buff.write(struct.pack(pattern, *val1.accelerations))
00109 _v1 = val1.time_from_start
00110 _x = _v1
00111 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00112 except struct.error, se: self._check_types(se)
00113 except TypeError, te: self._check_types(te)
00114
00115 def deserialize(self, str):
00116 """
00117 unpack serialized message in str into this message instance
00118 @param str: byte array of serialized message
00119 @type str: str
00120 """
00121 try:
00122 if self.trajectory is None:
00123 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00124 end = 0
00125 _x = self
00126 start = end
00127 end += 12
00128 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00129 start = end
00130 end += 4
00131 (length,) = _struct_I.unpack(str[start:end])
00132 start = end
00133 end += length
00134 self.trajectory.header.frame_id = str[start:end]
00135 start = end
00136 end += 4
00137 (length,) = _struct_I.unpack(str[start:end])
00138 self.trajectory.joint_names = []
00139 for i in xrange(0, length):
00140 start = end
00141 end += 4
00142 (length,) = _struct_I.unpack(str[start:end])
00143 start = end
00144 end += length
00145 val1 = str[start:end]
00146 self.trajectory.joint_names.append(val1)
00147 start = end
00148 end += 4
00149 (length,) = _struct_I.unpack(str[start:end])
00150 self.trajectory.points = []
00151 for i in xrange(0, length):
00152 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00153 start = end
00154 end += 4
00155 (length,) = _struct_I.unpack(str[start:end])
00156 pattern = '<%sd'%length
00157 start = end
00158 end += struct.calcsize(pattern)
00159 val1.positions = struct.unpack(pattern, str[start:end])
00160 start = end
00161 end += 4
00162 (length,) = _struct_I.unpack(str[start:end])
00163 pattern = '<%sd'%length
00164 start = end
00165 end += struct.calcsize(pattern)
00166 val1.velocities = struct.unpack(pattern, str[start:end])
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 pattern = '<%sd'%length
00171 start = end
00172 end += struct.calcsize(pattern)
00173 val1.accelerations = struct.unpack(pattern, str[start:end])
00174 _v2 = val1.time_from_start
00175 _x = _v2
00176 start = end
00177 end += 8
00178 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00179 self.trajectory.points.append(val1)
00180 return self
00181 except struct.error, e:
00182 raise roslib.message.DeserializationError(e)
00183
00184
00185 def serialize_numpy(self, buff, numpy):
00186 """
00187 serialize message with numpy array types into buffer
00188 @param buff: buffer
00189 @type buff: StringIO
00190 @param numpy: numpy python module
00191 @type numpy module
00192 """
00193 try:
00194 _x = self
00195 buff.write(_struct_3I.pack(_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs))
00196 _x = self.trajectory.header.frame_id
00197 length = len(_x)
00198 buff.write(struct.pack('<I%ss'%length, length, _x))
00199 length = len(self.trajectory.joint_names)
00200 buff.write(_struct_I.pack(length))
00201 for val1 in self.trajectory.joint_names:
00202 length = len(val1)
00203 buff.write(struct.pack('<I%ss'%length, length, val1))
00204 length = len(self.trajectory.points)
00205 buff.write(_struct_I.pack(length))
00206 for val1 in self.trajectory.points:
00207 length = len(val1.positions)
00208 buff.write(_struct_I.pack(length))
00209 pattern = '<%sd'%length
00210 buff.write(val1.positions.tostring())
00211 length = len(val1.velocities)
00212 buff.write(_struct_I.pack(length))
00213 pattern = '<%sd'%length
00214 buff.write(val1.velocities.tostring())
00215 length = len(val1.accelerations)
00216 buff.write(_struct_I.pack(length))
00217 pattern = '<%sd'%length
00218 buff.write(val1.accelerations.tostring())
00219 _v3 = val1.time_from_start
00220 _x = _v3
00221 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00222 except struct.error, se: self._check_types(se)
00223 except TypeError, te: self._check_types(te)
00224
00225 def deserialize_numpy(self, str, numpy):
00226 """
00227 unpack serialized message in str into this message instance using numpy for array types
00228 @param str: byte array of serialized message
00229 @type str: str
00230 @param numpy: numpy python module
00231 @type numpy: module
00232 """
00233 try:
00234 if self.trajectory is None:
00235 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00236 end = 0
00237 _x = self
00238 start = end
00239 end += 12
00240 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00241 start = end
00242 end += 4
00243 (length,) = _struct_I.unpack(str[start:end])
00244 start = end
00245 end += length
00246 self.trajectory.header.frame_id = str[start:end]
00247 start = end
00248 end += 4
00249 (length,) = _struct_I.unpack(str[start:end])
00250 self.trajectory.joint_names = []
00251 for i in xrange(0, length):
00252 start = end
00253 end += 4
00254 (length,) = _struct_I.unpack(str[start:end])
00255 start = end
00256 end += length
00257 val1 = str[start:end]
00258 self.trajectory.joint_names.append(val1)
00259 start = end
00260 end += 4
00261 (length,) = _struct_I.unpack(str[start:end])
00262 self.trajectory.points = []
00263 for i in xrange(0, length):
00264 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00265 start = end
00266 end += 4
00267 (length,) = _struct_I.unpack(str[start:end])
00268 pattern = '<%sd'%length
00269 start = end
00270 end += struct.calcsize(pattern)
00271 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00272 start = end
00273 end += 4
00274 (length,) = _struct_I.unpack(str[start:end])
00275 pattern = '<%sd'%length
00276 start = end
00277 end += struct.calcsize(pattern)
00278 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00279 start = end
00280 end += 4
00281 (length,) = _struct_I.unpack(str[start:end])
00282 pattern = '<%sd'%length
00283 start = end
00284 end += struct.calcsize(pattern)
00285 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00286 _v4 = val1.time_from_start
00287 _x = _v4
00288 start = end
00289 end += 8
00290 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00291 self.trajectory.points.append(val1)
00292 return self
00293 except struct.error, e:
00294 raise roslib.message.DeserializationError(e)
00295
00296 _struct_I = roslib.message.struct_I
00297 _struct_3I = struct.Struct("<3I")
00298 _struct_2i = struct.Struct("<2i")