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