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