$search
00001 """autogenerated by genmsg_py from HeadMonitorGoal.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 HeadMonitorGoal(roslib.message.Message): 00010 _md5sum = "da6613cef6b451043ab9d9442aa95deb" 00011 _type = "head_monitor_msgs/HeadMonitorGoal" 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 string group_name 00015 trajectory_msgs/JointTrajectory joint_trajectory 00016 00017 #goal definition 00018 duration time_offset 00019 string target_link 00020 00021 ================================================================================ 00022 MSG: trajectory_msgs/JointTrajectory 00023 Header header 00024 string[] joint_names 00025 JointTrajectoryPoint[] points 00026 ================================================================================ 00027 MSG: std_msgs/Header 00028 # Standard metadata for higher-level stamped data types. 00029 # This is generally used to communicate timestamped data 00030 # in a particular coordinate frame. 00031 # 00032 # sequence ID: consecutively increasing ID 00033 uint32 seq 00034 #Two-integer timestamp that is expressed as: 00035 # * stamp.secs: seconds (stamp_secs) since epoch 00036 # * stamp.nsecs: nanoseconds since stamp_secs 00037 # time-handling sugar is provided by the client library 00038 time stamp 00039 #Frame this data is associated with 00040 # 0: no frame 00041 # 1: global frame 00042 string frame_id 00043 00044 ================================================================================ 00045 MSG: trajectory_msgs/JointTrajectoryPoint 00046 float64[] positions 00047 float64[] velocities 00048 float64[] accelerations 00049 duration time_from_start 00050 """ 00051 __slots__ = ['group_name','joint_trajectory','time_offset','target_link'] 00052 _slot_types = ['string','trajectory_msgs/JointTrajectory','duration','string'] 00053 00054 def __init__(self, *args, **kwds): 00055 """ 00056 Constructor. Any message fields that are implicitly/explicitly 00057 set to None will be assigned a default value. The recommend 00058 use is keyword arguments as this is more robust to future message 00059 changes. You cannot mix in-order arguments and keyword arguments. 00060 00061 The available fields are: 00062 group_name,joint_trajectory,time_offset,target_link 00063 00064 @param args: complete set of field values, in .msg order 00065 @param kwds: use keyword arguments corresponding to message field names 00066 to set specific fields. 00067 """ 00068 if args or kwds: 00069 super(HeadMonitorGoal, self).__init__(*args, **kwds) 00070 #message fields cannot be None, assign default values for those that are 00071 if self.group_name is None: 00072 self.group_name = '' 00073 if self.joint_trajectory is None: 00074 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory() 00075 if self.time_offset is None: 00076 self.time_offset = roslib.rostime.Duration() 00077 if self.target_link is None: 00078 self.target_link = '' 00079 else: 00080 self.group_name = '' 00081 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory() 00082 self.time_offset = roslib.rostime.Duration() 00083 self.target_link = '' 00084 00085 def _get_types(self): 00086 """ 00087 internal API method 00088 """ 00089 return self._slot_types 00090 00091 def serialize(self, buff): 00092 """ 00093 serialize message into buffer 00094 @param buff: buffer 00095 @type buff: StringIO 00096 """ 00097 try: 00098 _x = self.group_name 00099 length = len(_x) 00100 buff.write(struct.pack('<I%ss'%length, length, _x)) 00101 _x = self 00102 buff.write(_struct_3I.pack(_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs)) 00103 _x = self.joint_trajectory.header.frame_id 00104 length = len(_x) 00105 buff.write(struct.pack('<I%ss'%length, length, _x)) 00106 length = len(self.joint_trajectory.joint_names) 00107 buff.write(_struct_I.pack(length)) 00108 for val1 in self.joint_trajectory.joint_names: 00109 length = len(val1) 00110 buff.write(struct.pack('<I%ss'%length, length, val1)) 00111 length = len(self.joint_trajectory.points) 00112 buff.write(_struct_I.pack(length)) 00113 for val1 in self.joint_trajectory.points: 00114 length = len(val1.positions) 00115 buff.write(_struct_I.pack(length)) 00116 pattern = '<%sd'%length 00117 buff.write(struct.pack(pattern, *val1.positions)) 00118 length = len(val1.velocities) 00119 buff.write(_struct_I.pack(length)) 00120 pattern = '<%sd'%length 00121 buff.write(struct.pack(pattern, *val1.velocities)) 00122 length = len(val1.accelerations) 00123 buff.write(_struct_I.pack(length)) 00124 pattern = '<%sd'%length 00125 buff.write(struct.pack(pattern, *val1.accelerations)) 00126 _v1 = val1.time_from_start 00127 _x = _v1 00128 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00129 _x = self 00130 buff.write(_struct_2i.pack(_x.time_offset.secs, _x.time_offset.nsecs)) 00131 _x = self.target_link 00132 length = len(_x) 00133 buff.write(struct.pack('<I%ss'%length, length, _x)) 00134 except struct.error as se: self._check_types(se) 00135 except TypeError as te: self._check_types(te) 00136 00137 def deserialize(self, str): 00138 """ 00139 unpack serialized message in str into this message instance 00140 @param str: byte array of serialized message 00141 @type str: str 00142 """ 00143 try: 00144 if self.joint_trajectory is None: 00145 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory() 00146 if self.time_offset is None: 00147 self.time_offset = roslib.rostime.Duration() 00148 end = 0 00149 start = end 00150 end += 4 00151 (length,) = _struct_I.unpack(str[start:end]) 00152 start = end 00153 end += length 00154 self.group_name = str[start:end] 00155 _x = self 00156 start = end 00157 end += 12 00158 (_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00159 start = end 00160 end += 4 00161 (length,) = _struct_I.unpack(str[start:end]) 00162 start = end 00163 end += length 00164 self.joint_trajectory.header.frame_id = str[start:end] 00165 start = end 00166 end += 4 00167 (length,) = _struct_I.unpack(str[start:end]) 00168 self.joint_trajectory.joint_names = [] 00169 for i in range(0, length): 00170 start = end 00171 end += 4 00172 (length,) = _struct_I.unpack(str[start:end]) 00173 start = end 00174 end += length 00175 val1 = str[start:end] 00176 self.joint_trajectory.joint_names.append(val1) 00177 start = end 00178 end += 4 00179 (length,) = _struct_I.unpack(str[start:end]) 00180 self.joint_trajectory.points = [] 00181 for i in range(0, length): 00182 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00183 start = end 00184 end += 4 00185 (length,) = _struct_I.unpack(str[start:end]) 00186 pattern = '<%sd'%length 00187 start = end 00188 end += struct.calcsize(pattern) 00189 val1.positions = struct.unpack(pattern, str[start:end]) 00190 start = end 00191 end += 4 00192 (length,) = _struct_I.unpack(str[start:end]) 00193 pattern = '<%sd'%length 00194 start = end 00195 end += struct.calcsize(pattern) 00196 val1.velocities = struct.unpack(pattern, str[start:end]) 00197 start = end 00198 end += 4 00199 (length,) = _struct_I.unpack(str[start:end]) 00200 pattern = '<%sd'%length 00201 start = end 00202 end += struct.calcsize(pattern) 00203 val1.accelerations = struct.unpack(pattern, str[start:end]) 00204 _v2 = val1.time_from_start 00205 _x = _v2 00206 start = end 00207 end += 8 00208 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00209 self.joint_trajectory.points.append(val1) 00210 _x = self 00211 start = end 00212 end += 8 00213 (_x.time_offset.secs, _x.time_offset.nsecs,) = _struct_2i.unpack(str[start:end]) 00214 start = end 00215 end += 4 00216 (length,) = _struct_I.unpack(str[start:end]) 00217 start = end 00218 end += length 00219 self.target_link = str[start:end] 00220 self.time_offset.canon() 00221 return self 00222 except struct.error as e: 00223 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00224 00225 00226 def serialize_numpy(self, buff, numpy): 00227 """ 00228 serialize message with numpy array types into buffer 00229 @param buff: buffer 00230 @type buff: StringIO 00231 @param numpy: numpy python module 00232 @type numpy module 00233 """ 00234 try: 00235 _x = self.group_name 00236 length = len(_x) 00237 buff.write(struct.pack('<I%ss'%length, length, _x)) 00238 _x = self 00239 buff.write(_struct_3I.pack(_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs)) 00240 _x = self.joint_trajectory.header.frame_id 00241 length = len(_x) 00242 buff.write(struct.pack('<I%ss'%length, length, _x)) 00243 length = len(self.joint_trajectory.joint_names) 00244 buff.write(_struct_I.pack(length)) 00245 for val1 in self.joint_trajectory.joint_names: 00246 length = len(val1) 00247 buff.write(struct.pack('<I%ss'%length, length, val1)) 00248 length = len(self.joint_trajectory.points) 00249 buff.write(_struct_I.pack(length)) 00250 for val1 in self.joint_trajectory.points: 00251 length = len(val1.positions) 00252 buff.write(_struct_I.pack(length)) 00253 pattern = '<%sd'%length 00254 buff.write(val1.positions.tostring()) 00255 length = len(val1.velocities) 00256 buff.write(_struct_I.pack(length)) 00257 pattern = '<%sd'%length 00258 buff.write(val1.velocities.tostring()) 00259 length = len(val1.accelerations) 00260 buff.write(_struct_I.pack(length)) 00261 pattern = '<%sd'%length 00262 buff.write(val1.accelerations.tostring()) 00263 _v3 = val1.time_from_start 00264 _x = _v3 00265 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00266 _x = self 00267 buff.write(_struct_2i.pack(_x.time_offset.secs, _x.time_offset.nsecs)) 00268 _x = self.target_link 00269 length = len(_x) 00270 buff.write(struct.pack('<I%ss'%length, length, _x)) 00271 except struct.error as se: self._check_types(se) 00272 except TypeError as te: self._check_types(te) 00273 00274 def deserialize_numpy(self, str, numpy): 00275 """ 00276 unpack serialized message in str into this message instance using numpy for array types 00277 @param str: byte array of serialized message 00278 @type str: str 00279 @param numpy: numpy python module 00280 @type numpy: module 00281 """ 00282 try: 00283 if self.joint_trajectory is None: 00284 self.joint_trajectory = trajectory_msgs.msg.JointTrajectory() 00285 if self.time_offset is None: 00286 self.time_offset = roslib.rostime.Duration() 00287 end = 0 00288 start = end 00289 end += 4 00290 (length,) = _struct_I.unpack(str[start:end]) 00291 start = end 00292 end += length 00293 self.group_name = str[start:end] 00294 _x = self 00295 start = end 00296 end += 12 00297 (_x.joint_trajectory.header.seq, _x.joint_trajectory.header.stamp.secs, _x.joint_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00298 start = end 00299 end += 4 00300 (length,) = _struct_I.unpack(str[start:end]) 00301 start = end 00302 end += length 00303 self.joint_trajectory.header.frame_id = str[start:end] 00304 start = end 00305 end += 4 00306 (length,) = _struct_I.unpack(str[start:end]) 00307 self.joint_trajectory.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 val1 = str[start:end] 00315 self.joint_trajectory.joint_names.append(val1) 00316 start = end 00317 end += 4 00318 (length,) = _struct_I.unpack(str[start:end]) 00319 self.joint_trajectory.points = [] 00320 for i in range(0, length): 00321 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00322 start = end 00323 end += 4 00324 (length,) = _struct_I.unpack(str[start:end]) 00325 pattern = '<%sd'%length 00326 start = end 00327 end += struct.calcsize(pattern) 00328 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00329 start = end 00330 end += 4 00331 (length,) = _struct_I.unpack(str[start:end]) 00332 pattern = '<%sd'%length 00333 start = end 00334 end += struct.calcsize(pattern) 00335 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00336 start = end 00337 end += 4 00338 (length,) = _struct_I.unpack(str[start:end]) 00339 pattern = '<%sd'%length 00340 start = end 00341 end += struct.calcsize(pattern) 00342 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00343 _v4 = val1.time_from_start 00344 _x = _v4 00345 start = end 00346 end += 8 00347 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00348 self.joint_trajectory.points.append(val1) 00349 _x = self 00350 start = end 00351 end += 8 00352 (_x.time_offset.secs, _x.time_offset.nsecs,) = _struct_2i.unpack(str[start:end]) 00353 start = end 00354 end += 4 00355 (length,) = _struct_I.unpack(str[start:end]) 00356 start = end 00357 end += length 00358 self.target_link = str[start:end] 00359 self.time_offset.canon() 00360 return self 00361 except struct.error as e: 00362 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00363 00364 _struct_I = roslib.message.struct_I 00365 _struct_3I = struct.Struct("<3I") 00366 _struct_2i = struct.Struct("<2i")