00001 """autogenerated by genpy from arm_navigation_msgs/MultiDOFJointTrajectory.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 arm_navigation_msgs.msg
00008 import geometry_msgs.msg
00009 import genpy
00010
00011 class MultiDOFJointTrajectory(genpy.Message):
00012 _md5sum = "524f128fb0a65e2838b0e3e3f75207d0"
00013 _type = "arm_navigation_msgs/MultiDOFJointTrajectory"
00014 _has_header = False
00015 _full_text = """#A representation of a multi-dof joint trajectory
00016 duration stamp
00017 string[] joint_names
00018 string[] frame_ids
00019 string[] child_frame_ids
00020 MultiDOFJointTrajectoryPoint[] points
00021
00022 ================================================================================
00023 MSG: arm_navigation_msgs/MultiDOFJointTrajectoryPoint
00024 geometry_msgs/Pose[] poses
00025 duration time_from_start
00026 ================================================================================
00027 MSG: geometry_msgs/Pose
00028 # A representation of pose in free space, composed of postion and orientation.
00029 Point position
00030 Quaternion orientation
00031
00032 ================================================================================
00033 MSG: geometry_msgs/Point
00034 # This contains the position of a point in free space
00035 float64 x
00036 float64 y
00037 float64 z
00038
00039 ================================================================================
00040 MSG: geometry_msgs/Quaternion
00041 # This represents an orientation in free space in quaternion form.
00042
00043 float64 x
00044 float64 y
00045 float64 z
00046 float64 w
00047
00048 """
00049 __slots__ = ['stamp','joint_names','frame_ids','child_frame_ids','points']
00050 _slot_types = ['duration','string[]','string[]','string[]','arm_navigation_msgs/MultiDOFJointTrajectoryPoint[]']
00051
00052 def __init__(self, *args, **kwds):
00053 """
00054 Constructor. Any message fields that are implicitly/explicitly
00055 set to None will be assigned a default value. The recommend
00056 use is keyword arguments as this is more robust to future message
00057 changes. You cannot mix in-order arguments and keyword arguments.
00058
00059 The available fields are:
00060 stamp,joint_names,frame_ids,child_frame_ids,points
00061
00062 :param args: complete set of field values, in .msg order
00063 :param kwds: use keyword arguments corresponding to message field names
00064 to set specific fields.
00065 """
00066 if args or kwds:
00067 super(MultiDOFJointTrajectory, self).__init__(*args, **kwds)
00068
00069 if self.stamp is None:
00070 self.stamp = genpy.Duration()
00071 if self.joint_names is None:
00072 self.joint_names = []
00073 if self.frame_ids is None:
00074 self.frame_ids = []
00075 if self.child_frame_ids is None:
00076 self.child_frame_ids = []
00077 if self.points is None:
00078 self.points = []
00079 else:
00080 self.stamp = genpy.Duration()
00081 self.joint_names = []
00082 self.frame_ids = []
00083 self.child_frame_ids = []
00084 self.points = []
00085
00086 def _get_types(self):
00087 """
00088 internal API method
00089 """
00090 return self._slot_types
00091
00092 def serialize(self, buff):
00093 """
00094 serialize message into buffer
00095 :param buff: buffer, ``StringIO``
00096 """
00097 try:
00098 _x = self
00099 buff.write(_struct_2i.pack(_x.stamp.secs, _x.stamp.nsecs))
00100 length = len(self.joint_names)
00101 buff.write(_struct_I.pack(length))
00102 for val1 in self.joint_names:
00103 length = len(val1)
00104 if python3 or type(val1) == unicode:
00105 val1 = val1.encode('utf-8')
00106 length = len(val1)
00107 buff.write(struct.pack('<I%ss'%length, length, val1))
00108 length = len(self.frame_ids)
00109 buff.write(_struct_I.pack(length))
00110 for val1 in self.frame_ids:
00111 length = len(val1)
00112 if python3 or type(val1) == unicode:
00113 val1 = val1.encode('utf-8')
00114 length = len(val1)
00115 buff.write(struct.pack('<I%ss'%length, length, val1))
00116 length = len(self.child_frame_ids)
00117 buff.write(_struct_I.pack(length))
00118 for val1 in self.child_frame_ids:
00119 length = len(val1)
00120 if python3 or type(val1) == unicode:
00121 val1 = val1.encode('utf-8')
00122 length = len(val1)
00123 buff.write(struct.pack('<I%ss'%length, length, val1))
00124 length = len(self.points)
00125 buff.write(_struct_I.pack(length))
00126 for val1 in self.points:
00127 length = len(val1.poses)
00128 buff.write(_struct_I.pack(length))
00129 for val2 in val1.poses:
00130 _v1 = val2.position
00131 _x = _v1
00132 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00133 _v2 = val2.orientation
00134 _x = _v2
00135 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00136 _v3 = val1.time_from_start
00137 _x = _v3
00138 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00139 except struct.error as se: self._check_types(se)
00140 except TypeError as te: self._check_types(te)
00141
00142 def deserialize(self, str):
00143 """
00144 unpack serialized message in str into this message instance
00145 :param str: byte array of serialized message, ``str``
00146 """
00147 try:
00148 if self.stamp is None:
00149 self.stamp = genpy.Duration()
00150 if self.points is None:
00151 self.points = None
00152 end = 0
00153 _x = self
00154 start = end
00155 end += 8
00156 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2i.unpack(str[start:end])
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 self.joint_names = []
00161 for i in range(0, length):
00162 start = end
00163 end += 4
00164 (length,) = _struct_I.unpack(str[start:end])
00165 start = end
00166 end += length
00167 if python3:
00168 val1 = str[start:end].decode('utf-8')
00169 else:
00170 val1 = str[start:end]
00171 self.joint_names.append(val1)
00172 start = end
00173 end += 4
00174 (length,) = _struct_I.unpack(str[start:end])
00175 self.frame_ids = []
00176 for i in range(0, length):
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 if python3:
00183 val1 = str[start:end].decode('utf-8')
00184 else:
00185 val1 = str[start:end]
00186 self.frame_ids.append(val1)
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 self.child_frame_ids = []
00191 for i in range(0, length):
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 start = end
00196 end += length
00197 if python3:
00198 val1 = str[start:end].decode('utf-8')
00199 else:
00200 val1 = str[start:end]
00201 self.child_frame_ids.append(val1)
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 self.points = []
00206 for i in range(0, length):
00207 val1 = arm_navigation_msgs.msg.MultiDOFJointTrajectoryPoint()
00208 start = end
00209 end += 4
00210 (length,) = _struct_I.unpack(str[start:end])
00211 val1.poses = []
00212 for i in range(0, length):
00213 val2 = geometry_msgs.msg.Pose()
00214 _v4 = val2.position
00215 _x = _v4
00216 start = end
00217 end += 24
00218 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00219 _v5 = val2.orientation
00220 _x = _v5
00221 start = end
00222 end += 32
00223 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00224 val1.poses.append(val2)
00225 _v6 = val1.time_from_start
00226 _x = _v6
00227 start = end
00228 end += 8
00229 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00230 self.points.append(val1)
00231 self.stamp.canon()
00232 return self
00233 except struct.error as e:
00234 raise genpy.DeserializationError(e)
00235
00236
00237 def serialize_numpy(self, buff, numpy):
00238 """
00239 serialize message with numpy array types into buffer
00240 :param buff: buffer, ``StringIO``
00241 :param numpy: numpy python module
00242 """
00243 try:
00244 _x = self
00245 buff.write(_struct_2i.pack(_x.stamp.secs, _x.stamp.nsecs))
00246 length = len(self.joint_names)
00247 buff.write(_struct_I.pack(length))
00248 for val1 in self.joint_names:
00249 length = len(val1)
00250 if python3 or type(val1) == unicode:
00251 val1 = val1.encode('utf-8')
00252 length = len(val1)
00253 buff.write(struct.pack('<I%ss'%length, length, val1))
00254 length = len(self.frame_ids)
00255 buff.write(_struct_I.pack(length))
00256 for val1 in self.frame_ids:
00257 length = len(val1)
00258 if python3 or type(val1) == unicode:
00259 val1 = val1.encode('utf-8')
00260 length = len(val1)
00261 buff.write(struct.pack('<I%ss'%length, length, val1))
00262 length = len(self.child_frame_ids)
00263 buff.write(_struct_I.pack(length))
00264 for val1 in self.child_frame_ids:
00265 length = len(val1)
00266 if python3 or type(val1) == unicode:
00267 val1 = val1.encode('utf-8')
00268 length = len(val1)
00269 buff.write(struct.pack('<I%ss'%length, length, val1))
00270 length = len(self.points)
00271 buff.write(_struct_I.pack(length))
00272 for val1 in self.points:
00273 length = len(val1.poses)
00274 buff.write(_struct_I.pack(length))
00275 for val2 in val1.poses:
00276 _v7 = val2.position
00277 _x = _v7
00278 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00279 _v8 = val2.orientation
00280 _x = _v8
00281 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00282 _v9 = val1.time_from_start
00283 _x = _v9
00284 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00285 except struct.error as se: self._check_types(se)
00286 except TypeError as te: self._check_types(te)
00287
00288 def deserialize_numpy(self, str, numpy):
00289 """
00290 unpack serialized message in str into this message instance using numpy for array types
00291 :param str: byte array of serialized message, ``str``
00292 :param numpy: numpy python module
00293 """
00294 try:
00295 if self.stamp is None:
00296 self.stamp = genpy.Duration()
00297 if self.points is None:
00298 self.points = None
00299 end = 0
00300 _x = self
00301 start = end
00302 end += 8
00303 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2i.unpack(str[start:end])
00304 start = end
00305 end += 4
00306 (length,) = _struct_I.unpack(str[start:end])
00307 self.joint_names = []
00308 for i in range(0, length):
00309 start = end
00310 end += 4
00311 (length,) = _struct_I.unpack(str[start:end])
00312 start = end
00313 end += length
00314 if python3:
00315 val1 = str[start:end].decode('utf-8')
00316 else:
00317 val1 = str[start:end]
00318 self.joint_names.append(val1)
00319 start = end
00320 end += 4
00321 (length,) = _struct_I.unpack(str[start:end])
00322 self.frame_ids = []
00323 for i in range(0, length):
00324 start = end
00325 end += 4
00326 (length,) = _struct_I.unpack(str[start:end])
00327 start = end
00328 end += length
00329 if python3:
00330 val1 = str[start:end].decode('utf-8')
00331 else:
00332 val1 = str[start:end]
00333 self.frame_ids.append(val1)
00334 start = end
00335 end += 4
00336 (length,) = _struct_I.unpack(str[start:end])
00337 self.child_frame_ids = []
00338 for i in range(0, length):
00339 start = end
00340 end += 4
00341 (length,) = _struct_I.unpack(str[start:end])
00342 start = end
00343 end += length
00344 if python3:
00345 val1 = str[start:end].decode('utf-8')
00346 else:
00347 val1 = str[start:end]
00348 self.child_frame_ids.append(val1)
00349 start = end
00350 end += 4
00351 (length,) = _struct_I.unpack(str[start:end])
00352 self.points = []
00353 for i in range(0, length):
00354 val1 = arm_navigation_msgs.msg.MultiDOFJointTrajectoryPoint()
00355 start = end
00356 end += 4
00357 (length,) = _struct_I.unpack(str[start:end])
00358 val1.poses = []
00359 for i in range(0, length):
00360 val2 = geometry_msgs.msg.Pose()
00361 _v10 = val2.position
00362 _x = _v10
00363 start = end
00364 end += 24
00365 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00366 _v11 = val2.orientation
00367 _x = _v11
00368 start = end
00369 end += 32
00370 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00371 val1.poses.append(val2)
00372 _v12 = val1.time_from_start
00373 _x = _v12
00374 start = end
00375 end += 8
00376 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00377 self.points.append(val1)
00378 self.stamp.canon()
00379 return self
00380 except struct.error as e:
00381 raise genpy.DeserializationError(e)
00382
00383 _struct_I = genpy.struct_I
00384 _struct_4d = struct.Struct("<4d")
00385 _struct_2i = struct.Struct("<2i")
00386 _struct_3d = struct.Struct("<3d")