$search
00001 """autogenerated by genmsg_py from JointTrajectoryGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import trajectory_msgs.msg 00006 import roslib.rostime 00007 import std_msgs.msg 00008 00009 class JointTrajectoryGoal(roslib.message.Message): 00010 _md5sum = "d206ff6714336d8099e6c534bc7eb204" 00011 _type = "nao_msgs/JointTrajectoryGoal" 00012 _has_header = False #flag to mark the presence of a Header object 00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00014 # goal: a joint angle trajectory 00015 trajectory_msgs/JointTrajectory trajectory 00016 # flag whether motion is absolute (=0, default) or relative (=1) 00017 uint8 relative 00018 00019 ================================================================================ 00020 MSG: trajectory_msgs/JointTrajectory 00021 Header header 00022 string[] joint_names 00023 JointTrajectoryPoint[] points 00024 ================================================================================ 00025 MSG: std_msgs/Header 00026 # Standard metadata for higher-level stamped data types. 00027 # This is generally used to communicate timestamped data 00028 # in a particular coordinate frame. 00029 # 00030 # sequence ID: consecutively increasing ID 00031 uint32 seq 00032 #Two-integer timestamp that is expressed as: 00033 # * stamp.secs: seconds (stamp_secs) since epoch 00034 # * stamp.nsecs: nanoseconds since stamp_secs 00035 # time-handling sugar is provided by the client library 00036 time stamp 00037 #Frame this data is associated with 00038 # 0: no frame 00039 # 1: global frame 00040 string frame_id 00041 00042 ================================================================================ 00043 MSG: trajectory_msgs/JointTrajectoryPoint 00044 float64[] positions 00045 float64[] velocities 00046 float64[] accelerations 00047 duration time_from_start 00048 """ 00049 __slots__ = ['trajectory','relative'] 00050 _slot_types = ['trajectory_msgs/JointTrajectory','uint8'] 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 trajectory,relative 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(JointTrajectoryGoal, self).__init__(*args, **kwds) 00068 #message fields cannot be None, assign default values for those that are 00069 if self.trajectory is None: 00070 self.trajectory = trajectory_msgs.msg.JointTrajectory() 00071 if self.relative is None: 00072 self.relative = 0 00073 else: 00074 self.trajectory = trajectory_msgs.msg.JointTrajectory() 00075 self.relative = 0 00076 00077 def _get_types(self): 00078 """ 00079 internal API method 00080 """ 00081 return self._slot_types 00082 00083 def serialize(self, buff): 00084 """ 00085 serialize message into buffer 00086 @param buff: buffer 00087 @type buff: 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 buff.write(struct.pack('<I%ss'%length, length, _x)) 00095 length = len(self.trajectory.joint_names) 00096 buff.write(_struct_I.pack(length)) 00097 for val1 in self.trajectory.joint_names: 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 buff.write(_struct_B.pack(self.relative)) 00119 except struct.error as se: self._check_types(se) 00120 except TypeError as te: self._check_types(te) 00121 00122 def deserialize(self, str): 00123 """ 00124 unpack serialized message in str into this message instance 00125 @param str: byte array of serialized message 00126 @type str: str 00127 """ 00128 try: 00129 if self.trajectory is None: 00130 self.trajectory = trajectory_msgs.msg.JointTrajectory() 00131 end = 0 00132 _x = self 00133 start = end 00134 end += 12 00135 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 start = end 00140 end += length 00141 self.trajectory.header.frame_id = str[start:end] 00142 start = end 00143 end += 4 00144 (length,) = _struct_I.unpack(str[start:end]) 00145 self.trajectory.joint_names = [] 00146 for i in range(0, length): 00147 start = end 00148 end += 4 00149 (length,) = _struct_I.unpack(str[start:end]) 00150 start = end 00151 end += length 00152 val1 = str[start:end] 00153 self.trajectory.joint_names.append(val1) 00154 start = end 00155 end += 4 00156 (length,) = _struct_I.unpack(str[start:end]) 00157 self.trajectory.points = [] 00158 for i in range(0, length): 00159 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00160 start = end 00161 end += 4 00162 (length,) = _struct_I.unpack(str[start:end]) 00163 pattern = '<%sd'%length 00164 start = end 00165 end += struct.calcsize(pattern) 00166 val1.positions = struct.unpack(pattern, str[start:end]) 00167 start = end 00168 end += 4 00169 (length,) = _struct_I.unpack(str[start:end]) 00170 pattern = '<%sd'%length 00171 start = end 00172 end += struct.calcsize(pattern) 00173 val1.velocities = struct.unpack(pattern, str[start:end]) 00174 start = end 00175 end += 4 00176 (length,) = _struct_I.unpack(str[start:end]) 00177 pattern = '<%sd'%length 00178 start = end 00179 end += struct.calcsize(pattern) 00180 val1.accelerations = struct.unpack(pattern, str[start:end]) 00181 _v2 = val1.time_from_start 00182 _x = _v2 00183 start = end 00184 end += 8 00185 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00186 self.trajectory.points.append(val1) 00187 start = end 00188 end += 1 00189 (self.relative,) = _struct_B.unpack(str[start:end]) 00190 return self 00191 except struct.error as e: 00192 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00193 00194 00195 def serialize_numpy(self, buff, numpy): 00196 """ 00197 serialize message with numpy array types into buffer 00198 @param buff: buffer 00199 @type buff: StringIO 00200 @param numpy: numpy python module 00201 @type numpy module 00202 """ 00203 try: 00204 _x = self 00205 buff.write(_struct_3I.pack(_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs)) 00206 _x = self.trajectory.header.frame_id 00207 length = len(_x) 00208 buff.write(struct.pack('<I%ss'%length, length, _x)) 00209 length = len(self.trajectory.joint_names) 00210 buff.write(_struct_I.pack(length)) 00211 for val1 in self.trajectory.joint_names: 00212 length = len(val1) 00213 buff.write(struct.pack('<I%ss'%length, length, val1)) 00214 length = len(self.trajectory.points) 00215 buff.write(_struct_I.pack(length)) 00216 for val1 in self.trajectory.points: 00217 length = len(val1.positions) 00218 buff.write(_struct_I.pack(length)) 00219 pattern = '<%sd'%length 00220 buff.write(val1.positions.tostring()) 00221 length = len(val1.velocities) 00222 buff.write(_struct_I.pack(length)) 00223 pattern = '<%sd'%length 00224 buff.write(val1.velocities.tostring()) 00225 length = len(val1.accelerations) 00226 buff.write(_struct_I.pack(length)) 00227 pattern = '<%sd'%length 00228 buff.write(val1.accelerations.tostring()) 00229 _v3 = val1.time_from_start 00230 _x = _v3 00231 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00232 buff.write(_struct_B.pack(self.relative)) 00233 except struct.error as se: self._check_types(se) 00234 except TypeError as te: self._check_types(te) 00235 00236 def deserialize_numpy(self, str, numpy): 00237 """ 00238 unpack serialized message in str into this message instance using numpy for array types 00239 @param str: byte array of serialized message 00240 @type str: str 00241 @param numpy: numpy python module 00242 @type numpy: module 00243 """ 00244 try: 00245 if self.trajectory is None: 00246 self.trajectory = trajectory_msgs.msg.JointTrajectory() 00247 end = 0 00248 _x = self 00249 start = end 00250 end += 12 00251 (_x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00252 start = end 00253 end += 4 00254 (length,) = _struct_I.unpack(str[start:end]) 00255 start = end 00256 end += length 00257 self.trajectory.header.frame_id = str[start:end] 00258 start = end 00259 end += 4 00260 (length,) = _struct_I.unpack(str[start:end]) 00261 self.trajectory.joint_names = [] 00262 for i in range(0, length): 00263 start = end 00264 end += 4 00265 (length,) = _struct_I.unpack(str[start:end]) 00266 start = end 00267 end += length 00268 val1 = str[start:end] 00269 self.trajectory.joint_names.append(val1) 00270 start = end 00271 end += 4 00272 (length,) = _struct_I.unpack(str[start:end]) 00273 self.trajectory.points = [] 00274 for i in range(0, length): 00275 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00276 start = end 00277 end += 4 00278 (length,) = _struct_I.unpack(str[start:end]) 00279 pattern = '<%sd'%length 00280 start = end 00281 end += struct.calcsize(pattern) 00282 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00283 start = end 00284 end += 4 00285 (length,) = _struct_I.unpack(str[start:end]) 00286 pattern = '<%sd'%length 00287 start = end 00288 end += struct.calcsize(pattern) 00289 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 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.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00297 _v4 = val1.time_from_start 00298 _x = _v4 00299 start = end 00300 end += 8 00301 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00302 self.trajectory.points.append(val1) 00303 start = end 00304 end += 1 00305 (self.relative,) = _struct_B.unpack(str[start:end]) 00306 return self 00307 except struct.error as e: 00308 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00309 00310 _struct_I = roslib.message.struct_I 00311 _struct_3I = struct.Struct("<3I") 00312 _struct_B = struct.Struct("<B") 00313 _struct_2i = struct.Struct("<2i")