00001 """autogenerated by genpy from cob_srvs/SetJointTrajectoryRequest.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 SetJointTrajectoryRequest(genpy.Message):
00012 _md5sum = "48a668811b715b51af6b3383511ae27f"
00013 _type = "cob_srvs/SetJointTrajectoryRequest"
00014 _has_header = False
00015 _full_text = """trajectory_msgs/JointTrajectory trajectory
00016
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 __slots__ = ['trajectory']
00048 _slot_types = ['trajectory_msgs/JointTrajectory']
00049
00050 def __init__(self, *args, **kwds):
00051 """
00052 Constructor. Any message fields that are implicitly/explicitly
00053 set to None will be assigned a default value. The recommend
00054 use is keyword arguments as this is more robust to future message
00055 changes. You cannot mix in-order arguments and keyword arguments.
00056
00057 The available fields are:
00058 trajectory
00059
00060 :param args: complete set of field values, in .msg order
00061 :param kwds: use keyword arguments corresponding to message field names
00062 to set specific fields.
00063 """
00064 if args or kwds:
00065 super(SetJointTrajectoryRequest, self).__init__(*args, **kwds)
00066
00067 if self.trajectory is None:
00068 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00069 else:
00070 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00071
00072 def _get_types(self):
00073 """
00074 internal API method
00075 """
00076 return self._slot_types
00077
00078 def serialize(self, buff):
00079 """
00080 serialize message into buffer
00081 :param buff: buffer, ``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 if python3 or type(_x) == unicode:
00089 _x = _x.encode('utf-8')
00090 length = len(_x)
00091 buff.write(struct.pack('<I%ss'%length, length, _x))
00092 length = len(self.trajectory.joint_names)
00093 buff.write(_struct_I.pack(length))
00094 for val1 in self.trajectory.joint_names:
00095 length = len(val1)
00096 if python3 or type(val1) == unicode:
00097 val1 = val1.encode('utf-8')
00098 length = len(val1)
00099 buff.write(struct.pack('<I%ss'%length, length, val1))
00100 length = len(self.trajectory.points)
00101 buff.write(_struct_I.pack(length))
00102 for val1 in self.trajectory.points:
00103 length = len(val1.positions)
00104 buff.write(_struct_I.pack(length))
00105 pattern = '<%sd'%length
00106 buff.write(struct.pack(pattern, *val1.positions))
00107 length = len(val1.velocities)
00108 buff.write(_struct_I.pack(length))
00109 pattern = '<%sd'%length
00110 buff.write(struct.pack(pattern, *val1.velocities))
00111 length = len(val1.accelerations)
00112 buff.write(_struct_I.pack(length))
00113 pattern = '<%sd'%length
00114 buff.write(struct.pack(pattern, *val1.accelerations))
00115 _v1 = val1.time_from_start
00116 _x = _v1
00117 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00118 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00119 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00120
00121 def deserialize(self, str):
00122 """
00123 unpack serialized message in str into this message instance
00124 :param str: byte array of serialized message, ``str``
00125 """
00126 try:
00127 if self.trajectory is None:
00128 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00129 end = 0
00130 _x = self
00131 start = end
00132 end += 12
00133 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00134 start = end
00135 end += 4
00136 (length,) = _struct_I.unpack(str[start:end])
00137 start = end
00138 end += length
00139 if python3:
00140 self.trajectory.header.frame_id = str[start:end].decode('utf-8')
00141 else:
00142 self.trajectory.header.frame_id = str[start:end]
00143 start = end
00144 end += 4
00145 (length,) = _struct_I.unpack(str[start:end])
00146 self.trajectory.joint_names = []
00147 for i in range(0, length):
00148 start = end
00149 end += 4
00150 (length,) = _struct_I.unpack(str[start:end])
00151 start = end
00152 end += length
00153 if python3:
00154 val1 = str[start:end].decode('utf-8')
00155 else:
00156 val1 = str[start:end]
00157 self.trajectory.joint_names.append(val1)
00158 start = end
00159 end += 4
00160 (length,) = _struct_I.unpack(str[start:end])
00161 self.trajectory.points = []
00162 for i in range(0, length):
00163 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00164 start = end
00165 end += 4
00166 (length,) = _struct_I.unpack(str[start:end])
00167 pattern = '<%sd'%length
00168 start = end
00169 end += struct.calcsize(pattern)
00170 val1.positions = struct.unpack(pattern, str[start:end])
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 pattern = '<%sd'%length
00175 start = end
00176 end += struct.calcsize(pattern)
00177 val1.velocities = struct.unpack(pattern, str[start:end])
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 pattern = '<%sd'%length
00182 start = end
00183 end += struct.calcsize(pattern)
00184 val1.accelerations = struct.unpack(pattern, str[start:end])
00185 _v2 = val1.time_from_start
00186 _x = _v2
00187 start = end
00188 end += 8
00189 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00190 self.trajectory.points.append(val1)
00191 return self
00192 except struct.error as e:
00193 raise genpy.DeserializationError(e)
00194
00195
00196 def serialize_numpy(self, buff, numpy):
00197 """
00198 serialize message with numpy array types into buffer
00199 :param buff: buffer, ``StringIO``
00200 :param numpy: numpy python module
00201 """
00202 try:
00203 _x = self
00204 buff.write(_struct_3I.pack(_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs))
00205 _x = self.trajectory.header.frame_id
00206 length = len(_x)
00207 if python3 or type(_x) == unicode:
00208 _x = _x.encode('utf-8')
00209 length = len(_x)
00210 buff.write(struct.pack('<I%ss'%length, length, _x))
00211 length = len(self.trajectory.joint_names)
00212 buff.write(_struct_I.pack(length))
00213 for val1 in self.trajectory.joint_names:
00214 length = len(val1)
00215 if python3 or type(val1) == unicode:
00216 val1 = val1.encode('utf-8')
00217 length = len(val1)
00218 buff.write(struct.pack('<I%ss'%length, length, val1))
00219 length = len(self.trajectory.points)
00220 buff.write(_struct_I.pack(length))
00221 for val1 in self.trajectory.points:
00222 length = len(val1.positions)
00223 buff.write(_struct_I.pack(length))
00224 pattern = '<%sd'%length
00225 buff.write(val1.positions.tostring())
00226 length = len(val1.velocities)
00227 buff.write(_struct_I.pack(length))
00228 pattern = '<%sd'%length
00229 buff.write(val1.velocities.tostring())
00230 length = len(val1.accelerations)
00231 buff.write(_struct_I.pack(length))
00232 pattern = '<%sd'%length
00233 buff.write(val1.accelerations.tostring())
00234 _v3 = val1.time_from_start
00235 _x = _v3
00236 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00237 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00238 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00239
00240 def deserialize_numpy(self, str, numpy):
00241 """
00242 unpack serialized message in str into this message instance using numpy for array types
00243 :param str: byte array of serialized message, ``str``
00244 :param numpy: numpy python module
00245 """
00246 try:
00247 if self.trajectory is None:
00248 self.trajectory = trajectory_msgs.msg.JointTrajectory()
00249 end = 0
00250 _x = self
00251 start = end
00252 end += 12
00253 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00254 start = end
00255 end += 4
00256 (length,) = _struct_I.unpack(str[start:end])
00257 start = end
00258 end += length
00259 if python3:
00260 self.trajectory.header.frame_id = str[start:end].decode('utf-8')
00261 else:
00262 self.trajectory.header.frame_id = str[start:end]
00263 start = end
00264 end += 4
00265 (length,) = _struct_I.unpack(str[start:end])
00266 self.trajectory.joint_names = []
00267 for i in range(0, length):
00268 start = end
00269 end += 4
00270 (length,) = _struct_I.unpack(str[start:end])
00271 start = end
00272 end += length
00273 if python3:
00274 val1 = str[start:end].decode('utf-8')
00275 else:
00276 val1 = str[start:end]
00277 self.trajectory.joint_names.append(val1)
00278 start = end
00279 end += 4
00280 (length,) = _struct_I.unpack(str[start:end])
00281 self.trajectory.points = []
00282 for i in range(0, length):
00283 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00284 start = end
00285 end += 4
00286 (length,) = _struct_I.unpack(str[start:end])
00287 pattern = '<%sd'%length
00288 start = end
00289 end += struct.calcsize(pattern)
00290 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00291 start = end
00292 end += 4
00293 (length,) = _struct_I.unpack(str[start:end])
00294 pattern = '<%sd'%length
00295 start = end
00296 end += struct.calcsize(pattern)
00297 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00298 start = end
00299 end += 4
00300 (length,) = _struct_I.unpack(str[start:end])
00301 pattern = '<%sd'%length
00302 start = end
00303 end += struct.calcsize(pattern)
00304 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00305 _v4 = val1.time_from_start
00306 _x = _v4
00307 start = end
00308 end += 8
00309 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00310 self.trajectory.points.append(val1)
00311 return self
00312 except struct.error as e:
00313 raise genpy.DeserializationError(e)
00314
00315 _struct_I = genpy.struct_I
00316 _struct_3I = struct.Struct("<3I")
00317 _struct_2i = struct.Struct("<2i")
00318 """autogenerated by genpy from cob_srvs/SetJointTrajectoryResponse.msg. Do not edit."""
00319 import sys
00320 python3 = True if sys.hexversion > 0x03000000 else False
00321 import genpy
00322 import struct
00323
00324 import std_msgs.msg
00325
00326 class SetJointTrajectoryResponse(genpy.Message):
00327 _md5sum = "fff2fd61c570b3016de5f27e6dc433be"
00328 _type = "cob_srvs/SetJointTrajectoryResponse"
00329 _has_header = False
00330 _full_text = """int64 success
00331 std_msgs/String errorMessage
00332
00333
00334 ================================================================================
00335 MSG: std_msgs/String
00336 string data
00337
00338 """
00339 __slots__ = ['success','errorMessage']
00340 _slot_types = ['int64','std_msgs/String']
00341
00342 def __init__(self, *args, **kwds):
00343 """
00344 Constructor. Any message fields that are implicitly/explicitly
00345 set to None will be assigned a default value. The recommend
00346 use is keyword arguments as this is more robust to future message
00347 changes. You cannot mix in-order arguments and keyword arguments.
00348
00349 The available fields are:
00350 success,errorMessage
00351
00352 :param args: complete set of field values, in .msg order
00353 :param kwds: use keyword arguments corresponding to message field names
00354 to set specific fields.
00355 """
00356 if args or kwds:
00357 super(SetJointTrajectoryResponse, self).__init__(*args, **kwds)
00358
00359 if self.success is None:
00360 self.success = 0
00361 if self.errorMessage is None:
00362 self.errorMessage = std_msgs.msg.String()
00363 else:
00364 self.success = 0
00365 self.errorMessage = std_msgs.msg.String()
00366
00367 def _get_types(self):
00368 """
00369 internal API method
00370 """
00371 return self._slot_types
00372
00373 def serialize(self, buff):
00374 """
00375 serialize message into buffer
00376 :param buff: buffer, ``StringIO``
00377 """
00378 try:
00379 buff.write(_struct_q.pack(self.success))
00380 _x = self.errorMessage.data
00381 length = len(_x)
00382 if python3 or type(_x) == unicode:
00383 _x = _x.encode('utf-8')
00384 length = len(_x)
00385 buff.write(struct.pack('<I%ss'%length, length, _x))
00386 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00387 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00388
00389 def deserialize(self, str):
00390 """
00391 unpack serialized message in str into this message instance
00392 :param str: byte array of serialized message, ``str``
00393 """
00394 try:
00395 if self.errorMessage is None:
00396 self.errorMessage = std_msgs.msg.String()
00397 end = 0
00398 start = end
00399 end += 8
00400 (self.success,) = _struct_q.unpack(str[start:end])
00401 start = end
00402 end += 4
00403 (length,) = _struct_I.unpack(str[start:end])
00404 start = end
00405 end += length
00406 if python3:
00407 self.errorMessage.data = str[start:end].decode('utf-8')
00408 else:
00409 self.errorMessage.data = str[start:end]
00410 return self
00411 except struct.error as e:
00412 raise genpy.DeserializationError(e)
00413
00414
00415 def serialize_numpy(self, buff, numpy):
00416 """
00417 serialize message with numpy array types into buffer
00418 :param buff: buffer, ``StringIO``
00419 :param numpy: numpy python module
00420 """
00421 try:
00422 buff.write(_struct_q.pack(self.success))
00423 _x = self.errorMessage.data
00424 length = len(_x)
00425 if python3 or type(_x) == unicode:
00426 _x = _x.encode('utf-8')
00427 length = len(_x)
00428 buff.write(struct.pack('<I%ss'%length, length, _x))
00429 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00430 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00431
00432 def deserialize_numpy(self, str, numpy):
00433 """
00434 unpack serialized message in str into this message instance using numpy for array types
00435 :param str: byte array of serialized message, ``str``
00436 :param numpy: numpy python module
00437 """
00438 try:
00439 if self.errorMessage is None:
00440 self.errorMessage = std_msgs.msg.String()
00441 end = 0
00442 start = end
00443 end += 8
00444 (self.success,) = _struct_q.unpack(str[start:end])
00445 start = end
00446 end += 4
00447 (length,) = _struct_I.unpack(str[start:end])
00448 start = end
00449 end += length
00450 if python3:
00451 self.errorMessage.data = str[start:end].decode('utf-8')
00452 else:
00453 self.errorMessage.data = str[start:end]
00454 return self
00455 except struct.error as e:
00456 raise genpy.DeserializationError(e)
00457
00458 _struct_I = genpy.struct_I
00459 _struct_q = struct.Struct("<q")
00460 class SetJointTrajectory(object):
00461 _type = 'cob_srvs/SetJointTrajectory'
00462 _md5sum = '09ae52e52b4c7dae8badb976ba693ba3'
00463 _request_class = SetJointTrajectoryRequest
00464 _response_class = SetJointTrajectoryResponse