00001 """autogenerated by genmsg_py from JointTrajectoryControllerState.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 JointTrajectoryControllerState(roslib.message.Message):
00010 _md5sum = "b11d532a92ee589417fdd76559eb1d9e"
00011 _type = "pr2_controllers_msgs/JointTrajectoryControllerState"
00012 _has_header = True
00013 _full_text = """Header header
00014 string[] joint_names
00015 trajectory_msgs/JointTrajectoryPoint desired
00016 trajectory_msgs/JointTrajectoryPoint actual
00017 trajectory_msgs/JointTrajectoryPoint error # Redundant, but useful
00018
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data
00023 # in a particular coordinate frame.
00024 #
00025 # sequence ID: consecutively increasing ID
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036
00037 ================================================================================
00038 MSG: trajectory_msgs/JointTrajectoryPoint
00039 float64[] positions
00040 float64[] velocities
00041 float64[] accelerations
00042 duration time_from_start
00043 """
00044 __slots__ = ['header','joint_names','desired','actual','error']
00045 _slot_types = ['Header','string[]','trajectory_msgs/JointTrajectoryPoint','trajectory_msgs/JointTrajectoryPoint','trajectory_msgs/JointTrajectoryPoint']
00046
00047 def __init__(self, *args, **kwds):
00048 """
00049 Constructor. Any message fields that are implicitly/explicitly
00050 set to None will be assigned a default value. The recommend
00051 use is keyword arguments as this is more robust to future message
00052 changes. You cannot mix in-order arguments and keyword arguments.
00053
00054 The available fields are:
00055 header,joint_names,desired,actual,error
00056
00057 @param args: complete set of field values, in .msg order
00058 @param kwds: use keyword arguments corresponding to message field names
00059 to set specific fields.
00060 """
00061 if args or kwds:
00062 super(JointTrajectoryControllerState, self).__init__(*args, **kwds)
00063
00064 if self.header is None:
00065 self.header = std_msgs.msg._Header.Header()
00066 if self.joint_names is None:
00067 self.joint_names = []
00068 if self.desired is None:
00069 self.desired = trajectory_msgs.msg.JointTrajectoryPoint()
00070 if self.actual is None:
00071 self.actual = trajectory_msgs.msg.JointTrajectoryPoint()
00072 if self.error is None:
00073 self.error = trajectory_msgs.msg.JointTrajectoryPoint()
00074 else:
00075 self.header = std_msgs.msg._Header.Header()
00076 self.joint_names = []
00077 self.desired = trajectory_msgs.msg.JointTrajectoryPoint()
00078 self.actual = trajectory_msgs.msg.JointTrajectoryPoint()
00079 self.error = trajectory_msgs.msg.JointTrajectoryPoint()
00080
00081 def _get_types(self):
00082 """
00083 internal API method
00084 """
00085 return self._slot_types
00086
00087 def serialize(self, buff):
00088 """
00089 serialize message into buffer
00090 @param buff: buffer
00091 @type buff: StringIO
00092 """
00093 try:
00094 _x = self
00095 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00096 _x = self.header.frame_id
00097 length = len(_x)
00098 buff.write(struct.pack('<I%ss'%length, length, _x))
00099 length = len(self.joint_names)
00100 buff.write(_struct_I.pack(length))
00101 for val1 in self.joint_names:
00102 length = len(val1)
00103 buff.write(struct.pack('<I%ss'%length, length, val1))
00104 length = len(self.desired.positions)
00105 buff.write(_struct_I.pack(length))
00106 pattern = '<%sd'%length
00107 buff.write(struct.pack(pattern, *self.desired.positions))
00108 length = len(self.desired.velocities)
00109 buff.write(_struct_I.pack(length))
00110 pattern = '<%sd'%length
00111 buff.write(struct.pack(pattern, *self.desired.velocities))
00112 length = len(self.desired.accelerations)
00113 buff.write(_struct_I.pack(length))
00114 pattern = '<%sd'%length
00115 buff.write(struct.pack(pattern, *self.desired.accelerations))
00116 _x = self
00117 buff.write(_struct_2i.pack(_x.desired.time_from_start.secs, _x.desired.time_from_start.nsecs))
00118 length = len(self.actual.positions)
00119 buff.write(_struct_I.pack(length))
00120 pattern = '<%sd'%length
00121 buff.write(struct.pack(pattern, *self.actual.positions))
00122 length = len(self.actual.velocities)
00123 buff.write(_struct_I.pack(length))
00124 pattern = '<%sd'%length
00125 buff.write(struct.pack(pattern, *self.actual.velocities))
00126 length = len(self.actual.accelerations)
00127 buff.write(_struct_I.pack(length))
00128 pattern = '<%sd'%length
00129 buff.write(struct.pack(pattern, *self.actual.accelerations))
00130 _x = self
00131 buff.write(_struct_2i.pack(_x.actual.time_from_start.secs, _x.actual.time_from_start.nsecs))
00132 length = len(self.error.positions)
00133 buff.write(_struct_I.pack(length))
00134 pattern = '<%sd'%length
00135 buff.write(struct.pack(pattern, *self.error.positions))
00136 length = len(self.error.velocities)
00137 buff.write(_struct_I.pack(length))
00138 pattern = '<%sd'%length
00139 buff.write(struct.pack(pattern, *self.error.velocities))
00140 length = len(self.error.accelerations)
00141 buff.write(_struct_I.pack(length))
00142 pattern = '<%sd'%length
00143 buff.write(struct.pack(pattern, *self.error.accelerations))
00144 _x = self
00145 buff.write(_struct_2i.pack(_x.error.time_from_start.secs, _x.error.time_from_start.nsecs))
00146 except struct.error, se: self._check_types(se)
00147 except TypeError, te: self._check_types(te)
00148
00149 def deserialize(self, str):
00150 """
00151 unpack serialized message in str into this message instance
00152 @param str: byte array of serialized message
00153 @type str: str
00154 """
00155 try:
00156 if self.header is None:
00157 self.header = std_msgs.msg._Header.Header()
00158 if self.desired is None:
00159 self.desired = trajectory_msgs.msg.JointTrajectoryPoint()
00160 if self.actual is None:
00161 self.actual = trajectory_msgs.msg.JointTrajectoryPoint()
00162 if self.error is None:
00163 self.error = trajectory_msgs.msg.JointTrajectoryPoint()
00164 end = 0
00165 _x = self
00166 start = end
00167 end += 12
00168 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00169 start = end
00170 end += 4
00171 (length,) = _struct_I.unpack(str[start:end])
00172 start = end
00173 end += length
00174 self.header.frame_id = str[start:end]
00175 start = end
00176 end += 4
00177 (length,) = _struct_I.unpack(str[start:end])
00178 self.joint_names = []
00179 for i in xrange(0, length):
00180 start = end
00181 end += 4
00182 (length,) = _struct_I.unpack(str[start:end])
00183 start = end
00184 end += length
00185 val1 = str[start:end]
00186 self.joint_names.append(val1)
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 pattern = '<%sd'%length
00191 start = end
00192 end += struct.calcsize(pattern)
00193 self.desired.positions = struct.unpack(pattern, str[start:end])
00194 start = end
00195 end += 4
00196 (length,) = _struct_I.unpack(str[start:end])
00197 pattern = '<%sd'%length
00198 start = end
00199 end += struct.calcsize(pattern)
00200 self.desired.velocities = struct.unpack(pattern, str[start:end])
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 pattern = '<%sd'%length
00205 start = end
00206 end += struct.calcsize(pattern)
00207 self.desired.accelerations = struct.unpack(pattern, str[start:end])
00208 _x = self
00209 start = end
00210 end += 8
00211 (_x.desired.time_from_start.secs, _x.desired.time_from_start.nsecs,) = _struct_2i.unpack(str[start:end])
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 pattern = '<%sd'%length
00216 start = end
00217 end += struct.calcsize(pattern)
00218 self.actual.positions = struct.unpack(pattern, str[start:end])
00219 start = end
00220 end += 4
00221 (length,) = _struct_I.unpack(str[start:end])
00222 pattern = '<%sd'%length
00223 start = end
00224 end += struct.calcsize(pattern)
00225 self.actual.velocities = struct.unpack(pattern, str[start:end])
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 self.actual.accelerations = struct.unpack(pattern, str[start:end])
00233 _x = self
00234 start = end
00235 end += 8
00236 (_x.actual.time_from_start.secs, _x.actual.time_from_start.nsecs,) = _struct_2i.unpack(str[start:end])
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 pattern = '<%sd'%length
00241 start = end
00242 end += struct.calcsize(pattern)
00243 self.error.positions = struct.unpack(pattern, str[start:end])
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 pattern = '<%sd'%length
00248 start = end
00249 end += struct.calcsize(pattern)
00250 self.error.velocities = struct.unpack(pattern, str[start:end])
00251 start = end
00252 end += 4
00253 (length,) = _struct_I.unpack(str[start:end])
00254 pattern = '<%sd'%length
00255 start = end
00256 end += struct.calcsize(pattern)
00257 self.error.accelerations = struct.unpack(pattern, str[start:end])
00258 _x = self
00259 start = end
00260 end += 8
00261 (_x.error.time_from_start.secs, _x.error.time_from_start.nsecs,) = _struct_2i.unpack(str[start:end])
00262 return self
00263 except struct.error, e:
00264 raise roslib.message.DeserializationError(e)
00265
00266
00267 def serialize_numpy(self, buff, numpy):
00268 """
00269 serialize message with numpy array types into buffer
00270 @param buff: buffer
00271 @type buff: StringIO
00272 @param numpy: numpy python module
00273 @type numpy module
00274 """
00275 try:
00276 _x = self
00277 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00278 _x = self.header.frame_id
00279 length = len(_x)
00280 buff.write(struct.pack('<I%ss'%length, length, _x))
00281 length = len(self.joint_names)
00282 buff.write(_struct_I.pack(length))
00283 for val1 in self.joint_names:
00284 length = len(val1)
00285 buff.write(struct.pack('<I%ss'%length, length, val1))
00286 length = len(self.desired.positions)
00287 buff.write(_struct_I.pack(length))
00288 pattern = '<%sd'%length
00289 buff.write(self.desired.positions.tostring())
00290 length = len(self.desired.velocities)
00291 buff.write(_struct_I.pack(length))
00292 pattern = '<%sd'%length
00293 buff.write(self.desired.velocities.tostring())
00294 length = len(self.desired.accelerations)
00295 buff.write(_struct_I.pack(length))
00296 pattern = '<%sd'%length
00297 buff.write(self.desired.accelerations.tostring())
00298 _x = self
00299 buff.write(_struct_2i.pack(_x.desired.time_from_start.secs, _x.desired.time_from_start.nsecs))
00300 length = len(self.actual.positions)
00301 buff.write(_struct_I.pack(length))
00302 pattern = '<%sd'%length
00303 buff.write(self.actual.positions.tostring())
00304 length = len(self.actual.velocities)
00305 buff.write(_struct_I.pack(length))
00306 pattern = '<%sd'%length
00307 buff.write(self.actual.velocities.tostring())
00308 length = len(self.actual.accelerations)
00309 buff.write(_struct_I.pack(length))
00310 pattern = '<%sd'%length
00311 buff.write(self.actual.accelerations.tostring())
00312 _x = self
00313 buff.write(_struct_2i.pack(_x.actual.time_from_start.secs, _x.actual.time_from_start.nsecs))
00314 length = len(self.error.positions)
00315 buff.write(_struct_I.pack(length))
00316 pattern = '<%sd'%length
00317 buff.write(self.error.positions.tostring())
00318 length = len(self.error.velocities)
00319 buff.write(_struct_I.pack(length))
00320 pattern = '<%sd'%length
00321 buff.write(self.error.velocities.tostring())
00322 length = len(self.error.accelerations)
00323 buff.write(_struct_I.pack(length))
00324 pattern = '<%sd'%length
00325 buff.write(self.error.accelerations.tostring())
00326 _x = self
00327 buff.write(_struct_2i.pack(_x.error.time_from_start.secs, _x.error.time_from_start.nsecs))
00328 except struct.error, se: self._check_types(se)
00329 except TypeError, te: self._check_types(te)
00330
00331 def deserialize_numpy(self, str, numpy):
00332 """
00333 unpack serialized message in str into this message instance using numpy for array types
00334 @param str: byte array of serialized message
00335 @type str: str
00336 @param numpy: numpy python module
00337 @type numpy: module
00338 """
00339 try:
00340 if self.header is None:
00341 self.header = std_msgs.msg._Header.Header()
00342 if self.desired is None:
00343 self.desired = trajectory_msgs.msg.JointTrajectoryPoint()
00344 if self.actual is None:
00345 self.actual = trajectory_msgs.msg.JointTrajectoryPoint()
00346 if self.error is None:
00347 self.error = trajectory_msgs.msg.JointTrajectoryPoint()
00348 end = 0
00349 _x = self
00350 start = end
00351 end += 12
00352 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00353 start = end
00354 end += 4
00355 (length,) = _struct_I.unpack(str[start:end])
00356 start = end
00357 end += length
00358 self.header.frame_id = str[start:end]
00359 start = end
00360 end += 4
00361 (length,) = _struct_I.unpack(str[start:end])
00362 self.joint_names = []
00363 for i in xrange(0, length):
00364 start = end
00365 end += 4
00366 (length,) = _struct_I.unpack(str[start:end])
00367 start = end
00368 end += length
00369 val1 = str[start:end]
00370 self.joint_names.append(val1)
00371 start = end
00372 end += 4
00373 (length,) = _struct_I.unpack(str[start:end])
00374 pattern = '<%sd'%length
00375 start = end
00376 end += struct.calcsize(pattern)
00377 self.desired.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00378 start = end
00379 end += 4
00380 (length,) = _struct_I.unpack(str[start:end])
00381 pattern = '<%sd'%length
00382 start = end
00383 end += struct.calcsize(pattern)
00384 self.desired.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00385 start = end
00386 end += 4
00387 (length,) = _struct_I.unpack(str[start:end])
00388 pattern = '<%sd'%length
00389 start = end
00390 end += struct.calcsize(pattern)
00391 self.desired.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00392 _x = self
00393 start = end
00394 end += 8
00395 (_x.desired.time_from_start.secs, _x.desired.time_from_start.nsecs,) = _struct_2i.unpack(str[start:end])
00396 start = end
00397 end += 4
00398 (length,) = _struct_I.unpack(str[start:end])
00399 pattern = '<%sd'%length
00400 start = end
00401 end += struct.calcsize(pattern)
00402 self.actual.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00403 start = end
00404 end += 4
00405 (length,) = _struct_I.unpack(str[start:end])
00406 pattern = '<%sd'%length
00407 start = end
00408 end += struct.calcsize(pattern)
00409 self.actual.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00410 start = end
00411 end += 4
00412 (length,) = _struct_I.unpack(str[start:end])
00413 pattern = '<%sd'%length
00414 start = end
00415 end += struct.calcsize(pattern)
00416 self.actual.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00417 _x = self
00418 start = end
00419 end += 8
00420 (_x.actual.time_from_start.secs, _x.actual.time_from_start.nsecs,) = _struct_2i.unpack(str[start:end])
00421 start = end
00422 end += 4
00423 (length,) = _struct_I.unpack(str[start:end])
00424 pattern = '<%sd'%length
00425 start = end
00426 end += struct.calcsize(pattern)
00427 self.error.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00428 start = end
00429 end += 4
00430 (length,) = _struct_I.unpack(str[start:end])
00431 pattern = '<%sd'%length
00432 start = end
00433 end += struct.calcsize(pattern)
00434 self.error.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00435 start = end
00436 end += 4
00437 (length,) = _struct_I.unpack(str[start:end])
00438 pattern = '<%sd'%length
00439 start = end
00440 end += struct.calcsize(pattern)
00441 self.error.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00442 _x = self
00443 start = end
00444 end += 8
00445 (_x.error.time_from_start.secs, _x.error.time_from_start.nsecs,) = _struct_2i.unpack(str[start:end])
00446 return self
00447 except struct.error, e:
00448 raise roslib.message.DeserializationError(e)
00449
00450 _struct_I = roslib.message.struct_I
00451 _struct_3I = struct.Struct("<3I")
00452 _struct_2i = struct.Struct("<2i")