00001 """autogenerated by genmsg_py from JointTrajectoryWithLimits.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 roslib.rostime
00008 import std_msgs.msg
00009
00010 class JointTrajectoryWithLimits(roslib.message.Message):
00011 _md5sum = "b660f30745c6b6b6b02a82fb820faea8"
00012 _type = "motion_planning_msgs/JointTrajectoryWithLimits"
00013 _has_header = False
00014 _full_text = """# A trajectory message that encodes joint limits within it.
00015 trajectory_msgs/JointTrajectory trajectory
00016
00017 # A vector of JointLimit messages.
00018 # Each message contains the limits for a specific joint
00019 motion_planning_msgs/JointLimits[] limits
00020 ================================================================================
00021 MSG: trajectory_msgs/JointTrajectory
00022 Header header
00023 string[] joint_names
00024 JointTrajectoryPoint[] points
00025 ================================================================================
00026 MSG: std_msgs/Header
00027 # Standard metadata for higher-level stamped data types.
00028 # This is generally used to communicate timestamped data
00029 # in a particular coordinate frame.
00030 #
00031 # sequence ID: consecutively increasing ID
00032 uint32 seq
00033 #Two-integer timestamp that is expressed as:
00034 # * stamp.secs: seconds (stamp_secs) since epoch
00035 # * stamp.nsecs: nanoseconds since stamp_secs
00036 # time-handling sugar is provided by the client library
00037 time stamp
00038 #Frame this data is associated with
00039 # 0: no frame
00040 # 1: global frame
00041 string frame_id
00042
00043 ================================================================================
00044 MSG: trajectory_msgs/JointTrajectoryPoint
00045 float64[] positions
00046 float64[] velocities
00047 float64[] accelerations
00048 duration time_from_start
00049 ================================================================================
00050 MSG: motion_planning_msgs/JointLimits
00051 # This message contains information about limits of a particular joint (or control dimension)
00052 string joint_name
00053
00054 # true if the joint has position limits
00055 uint8 has_position_limits
00056
00057 # min and max position limits
00058 float64 min_position
00059 float64 max_position
00060
00061 # true if joint has velocity limits
00062 uint8 has_velocity_limits
00063
00064 # max velocity limit
00065 float64 max_velocity
00066 # min_velocity is assumed to be -max_velocity
00067
00068 # true if joint has acceleration limits
00069 uint8 has_acceleration_limits
00070 # max acceleration limit
00071 float64 max_acceleration
00072 # min_acceleration is assumed to be -max_acceleration
00073
00074 """
00075 __slots__ = ['trajectory','limits']
00076 _slot_types = ['trajectory_msgs/JointTrajectory','motion_planning_msgs/JointLimits[]']
00077
00078 def __init__(self, *args, **kwds):
00079 """
00080 Constructor. Any message fields that are implicitly/explicitly
00081 set to None will be assigned a default value. The recommend
00082 use is keyword arguments as this is more robust to future message
00083 changes. You cannot mix in-order arguments and keyword arguments.
00084
00085 The available fields are:
00086 trajectory,limits
00087
00088 @param args: complete set of field values, in .msg order
00089 @param kwds: use keyword arguments corresponding to message field names
00090 to set specific fields.
00091 """
00092 if args or kwds:
00093 super(JointTrajectoryWithLimits, self).__init__(*args, **kwds)
00094
00095 if self.trajectory is None:
00096 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00097 if self.limits is None:
00098 self.limits = []
00099 else:
00100 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00101 self.limits = []
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.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs))
00118 _x = self.trajectory.header.frame_id
00119 length = len(_x)
00120 buff.write(struct.pack('<I%ss'%length, length, _x))
00121 length = len(self.trajectory.joint_names)
00122 buff.write(_struct_I.pack(length))
00123 for val1 in self.trajectory.joint_names:
00124 length = len(val1)
00125 buff.write(struct.pack('<I%ss'%length, length, val1))
00126 length = len(self.trajectory.points)
00127 buff.write(_struct_I.pack(length))
00128 for val1 in self.trajectory.points:
00129 length = len(val1.positions)
00130 buff.write(_struct_I.pack(length))
00131 pattern = '<%sd'%length
00132 buff.write(struct.pack(pattern, *val1.positions))
00133 length = len(val1.velocities)
00134 buff.write(_struct_I.pack(length))
00135 pattern = '<%sd'%length
00136 buff.write(struct.pack(pattern, *val1.velocities))
00137 length = len(val1.accelerations)
00138 buff.write(_struct_I.pack(length))
00139 pattern = '<%sd'%length
00140 buff.write(struct.pack(pattern, *val1.accelerations))
00141 _v1 = val1.time_from_start
00142 _x = _v1
00143 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00144 length = len(self.limits)
00145 buff.write(_struct_I.pack(length))
00146 for val1 in self.limits:
00147 _x = val1.joint_name
00148 length = len(_x)
00149 buff.write(struct.pack('<I%ss'%length, length, _x))
00150 _x = val1
00151 buff.write(_struct_B2dBdBd.pack(_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration))
00152 except struct.error, se: self._check_types(se)
00153 except TypeError, te: self._check_types(te)
00154
00155 def deserialize(self, str):
00156 """
00157 unpack serialized message in str into this message instance
00158 @param str: byte array of serialized message
00159 @type str: str
00160 """
00161 try:
00162 if self.trajectory is None:
00163 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00164 end = 0
00165 _x = self
00166 start = end
00167 end += 12
00168 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.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.trajectory.header.frame_id = str[start:end]
00175 start = end
00176 end += 4
00177 (length,) = _struct_I.unpack(str[start:end])
00178 self.trajectory.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.trajectory.joint_names.append(val1)
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 self.trajectory.points = []
00191 for i in xrange(0, length):
00192 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00193 start = end
00194 end += 4
00195 (length,) = _struct_I.unpack(str[start:end])
00196 pattern = '<%sd'%length
00197 start = end
00198 end += struct.calcsize(pattern)
00199 val1.positions = struct.unpack(pattern, str[start:end])
00200 start = end
00201 end += 4
00202 (length,) = _struct_I.unpack(str[start:end])
00203 pattern = '<%sd'%length
00204 start = end
00205 end += struct.calcsize(pattern)
00206 val1.velocities = struct.unpack(pattern, str[start:end])
00207 start = end
00208 end += 4
00209 (length,) = _struct_I.unpack(str[start:end])
00210 pattern = '<%sd'%length
00211 start = end
00212 end += struct.calcsize(pattern)
00213 val1.accelerations = struct.unpack(pattern, str[start:end])
00214 _v2 = val1.time_from_start
00215 _x = _v2
00216 start = end
00217 end += 8
00218 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00219 self.trajectory.points.append(val1)
00220 start = end
00221 end += 4
00222 (length,) = _struct_I.unpack(str[start:end])
00223 self.limits = []
00224 for i in xrange(0, length):
00225 val1 = motion_planning_msgs.msg.JointLimits()
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 start = end
00230 end += length
00231 val1.joint_name = str[start:end]
00232 _x = val1
00233 start = end
00234 end += 35
00235 (_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration,) = _struct_B2dBdBd.unpack(str[start:end])
00236 self.limits.append(val1)
00237 return self
00238 except struct.error, e:
00239 raise roslib.message.DeserializationError(e)
00240
00241
00242 def serialize_numpy(self, buff, numpy):
00243 """
00244 serialize message with numpy array types into buffer
00245 @param buff: buffer
00246 @type buff: StringIO
00247 @param numpy: numpy python module
00248 @type numpy module
00249 """
00250 try:
00251 _x = self
00252 buff.write(_struct_3I.pack(_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs))
00253 _x = self.trajectory.header.frame_id
00254 length = len(_x)
00255 buff.write(struct.pack('<I%ss'%length, length, _x))
00256 length = len(self.trajectory.joint_names)
00257 buff.write(_struct_I.pack(length))
00258 for val1 in self.trajectory.joint_names:
00259 length = len(val1)
00260 buff.write(struct.pack('<I%ss'%length, length, val1))
00261 length = len(self.trajectory.points)
00262 buff.write(_struct_I.pack(length))
00263 for val1 in self.trajectory.points:
00264 length = len(val1.positions)
00265 buff.write(_struct_I.pack(length))
00266 pattern = '<%sd'%length
00267 buff.write(val1.positions.tostring())
00268 length = len(val1.velocities)
00269 buff.write(_struct_I.pack(length))
00270 pattern = '<%sd'%length
00271 buff.write(val1.velocities.tostring())
00272 length = len(val1.accelerations)
00273 buff.write(_struct_I.pack(length))
00274 pattern = '<%sd'%length
00275 buff.write(val1.accelerations.tostring())
00276 _v3 = val1.time_from_start
00277 _x = _v3
00278 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00279 length = len(self.limits)
00280 buff.write(_struct_I.pack(length))
00281 for val1 in self.limits:
00282 _x = val1.joint_name
00283 length = len(_x)
00284 buff.write(struct.pack('<I%ss'%length, length, _x))
00285 _x = val1
00286 buff.write(_struct_B2dBdBd.pack(_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration))
00287 except struct.error, se: self._check_types(se)
00288 except TypeError, te: self._check_types(te)
00289
00290 def deserialize_numpy(self, str, numpy):
00291 """
00292 unpack serialized message in str into this message instance using numpy for array types
00293 @param str: byte array of serialized message
00294 @type str: str
00295 @param numpy: numpy python module
00296 @type numpy: module
00297 """
00298 try:
00299 if self.trajectory is None:
00300 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00301 end = 0
00302 _x = self
00303 start = end
00304 end += 12
00305 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00306 start = end
00307 end += 4
00308 (length,) = _struct_I.unpack(str[start:end])
00309 start = end
00310 end += length
00311 self.trajectory.header.frame_id = str[start:end]
00312 start = end
00313 end += 4
00314 (length,) = _struct_I.unpack(str[start:end])
00315 self.trajectory.joint_names = []
00316 for i in xrange(0, length):
00317 start = end
00318 end += 4
00319 (length,) = _struct_I.unpack(str[start:end])
00320 start = end
00321 end += length
00322 val1 = str[start:end]
00323 self.trajectory.joint_names.append(val1)
00324 start = end
00325 end += 4
00326 (length,) = _struct_I.unpack(str[start:end])
00327 self.trajectory.points = []
00328 for i in xrange(0, length):
00329 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00330 start = end
00331 end += 4
00332 (length,) = _struct_I.unpack(str[start:end])
00333 pattern = '<%sd'%length
00334 start = end
00335 end += struct.calcsize(pattern)
00336 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00337 start = end
00338 end += 4
00339 (length,) = _struct_I.unpack(str[start:end])
00340 pattern = '<%sd'%length
00341 start = end
00342 end += struct.calcsize(pattern)
00343 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00344 start = end
00345 end += 4
00346 (length,) = _struct_I.unpack(str[start:end])
00347 pattern = '<%sd'%length
00348 start = end
00349 end += struct.calcsize(pattern)
00350 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00351 _v4 = val1.time_from_start
00352 _x = _v4
00353 start = end
00354 end += 8
00355 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00356 self.trajectory.points.append(val1)
00357 start = end
00358 end += 4
00359 (length,) = _struct_I.unpack(str[start:end])
00360 self.limits = []
00361 for i in xrange(0, length):
00362 val1 = motion_planning_msgs.msg.JointLimits()
00363 start = end
00364 end += 4
00365 (length,) = _struct_I.unpack(str[start:end])
00366 start = end
00367 end += length
00368 val1.joint_name = str[start:end]
00369 _x = val1
00370 start = end
00371 end += 35
00372 (_x.has_position_limits, _x.min_position, _x.max_position, _x.has_velocity_limits, _x.max_velocity, _x.has_acceleration_limits, _x.max_acceleration,) = _struct_B2dBdBd.unpack(str[start:end])
00373 self.limits.append(val1)
00374 return self
00375 except struct.error, e:
00376 raise roslib.message.DeserializationError(e)
00377
00378 _struct_I = roslib.message.struct_I
00379 _struct_3I = struct.Struct("<3I")
00380 _struct_2i = struct.Struct("<2i")
00381 _struct_B2dBdBd = struct.Struct("<B2dBdBd")