$search
00001 """autogenerated by genmsg_py from HeadMonitorActionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import trajectory_msgs.msg 00006 import head_monitor_msgs.msg 00007 import roslib.rostime 00008 import actionlib_msgs.msg 00009 import std_msgs.msg 00010 00011 class HeadMonitorActionGoal(roslib.message.Message): 00012 _md5sum = "54b0e0edbc45f5ac22248b15314fc2b1" 00013 _type = "head_monitor_msgs/HeadMonitorActionGoal" 00014 _has_header = True #flag to mark the presence of a Header object 00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00016 00017 Header header 00018 actionlib_msgs/GoalID goal_id 00019 HeadMonitorGoal goal 00020 00021 ================================================================================ 00022 MSG: std_msgs/Header 00023 # Standard metadata for higher-level stamped data types. 00024 # This is generally used to communicate timestamped data 00025 # in a particular coordinate frame. 00026 # 00027 # sequence ID: consecutively increasing ID 00028 uint32 seq 00029 #Two-integer timestamp that is expressed as: 00030 # * stamp.secs: seconds (stamp_secs) since epoch 00031 # * stamp.nsecs: nanoseconds since stamp_secs 00032 # time-handling sugar is provided by the client library 00033 time stamp 00034 #Frame this data is associated with 00035 # 0: no frame 00036 # 1: global frame 00037 string frame_id 00038 00039 ================================================================================ 00040 MSG: actionlib_msgs/GoalID 00041 # The stamp should store the time at which this goal was requested. 00042 # It is used by an action server when it tries to preempt all 00043 # goals that were requested before a certain time 00044 time stamp 00045 00046 # The id provides a way to associate feedback and 00047 # result message with specific goal requests. The id 00048 # specified must be unique. 00049 string id 00050 00051 00052 ================================================================================ 00053 MSG: head_monitor_msgs/HeadMonitorGoal 00054 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00055 string group_name 00056 trajectory_msgs/JointTrajectory joint_trajectory 00057 00058 #goal definition 00059 duration time_offset 00060 string target_link 00061 00062 ================================================================================ 00063 MSG: trajectory_msgs/JointTrajectory 00064 Header header 00065 string[] joint_names 00066 JointTrajectoryPoint[] points 00067 ================================================================================ 00068 MSG: trajectory_msgs/JointTrajectoryPoint 00069 float64[] positions 00070 float64[] velocities 00071 float64[] accelerations 00072 duration time_from_start 00073 """ 00074 __slots__ = ['header','goal_id','goal'] 00075 _slot_types = ['Header','actionlib_msgs/GoalID','head_monitor_msgs/HeadMonitorGoal'] 00076 00077 def __init__(self, *args, **kwds): 00078 """ 00079 Constructor. Any message fields that are implicitly/explicitly 00080 set to None will be assigned a default value. The recommend 00081 use is keyword arguments as this is more robust to future message 00082 changes. You cannot mix in-order arguments and keyword arguments. 00083 00084 The available fields are: 00085 header,goal_id,goal 00086 00087 @param args: complete set of field values, in .msg order 00088 @param kwds: use keyword arguments corresponding to message field names 00089 to set specific fields. 00090 """ 00091 if args or kwds: 00092 super(HeadMonitorActionGoal, self).__init__(*args, **kwds) 00093 #message fields cannot be None, assign default values for those that are 00094 if self.header is None: 00095 self.header = std_msgs.msg._Header.Header() 00096 if self.goal_id is None: 00097 self.goal_id = actionlib_msgs.msg.GoalID() 00098 if self.goal is None: 00099 self.goal = head_monitor_msgs.msg.HeadMonitorGoal() 00100 else: 00101 self.header = std_msgs.msg._Header.Header() 00102 self.goal_id = actionlib_msgs.msg.GoalID() 00103 self.goal = head_monitor_msgs.msg.HeadMonitorGoal() 00104 00105 def _get_types(self): 00106 """ 00107 internal API method 00108 """ 00109 return self._slot_types 00110 00111 def serialize(self, buff): 00112 """ 00113 serialize message into buffer 00114 @param buff: buffer 00115 @type buff: StringIO 00116 """ 00117 try: 00118 _x = self 00119 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00120 _x = self.header.frame_id 00121 length = len(_x) 00122 buff.write(struct.pack('<I%ss'%length, length, _x)) 00123 _x = self 00124 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00125 _x = self.goal_id.id 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 _x = self.goal.group_name 00129 length = len(_x) 00130 buff.write(struct.pack('<I%ss'%length, length, _x)) 00131 _x = self 00132 buff.write(_struct_3I.pack(_x.goal.joint_trajectory.header.seq, _x.goal.joint_trajectory.header.stamp.secs, _x.goal.joint_trajectory.header.stamp.nsecs)) 00133 _x = self.goal.joint_trajectory.header.frame_id 00134 length = len(_x) 00135 buff.write(struct.pack('<I%ss'%length, length, _x)) 00136 length = len(self.goal.joint_trajectory.joint_names) 00137 buff.write(_struct_I.pack(length)) 00138 for val1 in self.goal.joint_trajectory.joint_names: 00139 length = len(val1) 00140 buff.write(struct.pack('<I%ss'%length, length, val1)) 00141 length = len(self.goal.joint_trajectory.points) 00142 buff.write(_struct_I.pack(length)) 00143 for val1 in self.goal.joint_trajectory.points: 00144 length = len(val1.positions) 00145 buff.write(_struct_I.pack(length)) 00146 pattern = '<%sd'%length 00147 buff.write(struct.pack(pattern, *val1.positions)) 00148 length = len(val1.velocities) 00149 buff.write(_struct_I.pack(length)) 00150 pattern = '<%sd'%length 00151 buff.write(struct.pack(pattern, *val1.velocities)) 00152 length = len(val1.accelerations) 00153 buff.write(_struct_I.pack(length)) 00154 pattern = '<%sd'%length 00155 buff.write(struct.pack(pattern, *val1.accelerations)) 00156 _v1 = val1.time_from_start 00157 _x = _v1 00158 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00159 _x = self 00160 buff.write(_struct_2i.pack(_x.goal.time_offset.secs, _x.goal.time_offset.nsecs)) 00161 _x = self.goal.target_link 00162 length = len(_x) 00163 buff.write(struct.pack('<I%ss'%length, length, _x)) 00164 except struct.error as se: self._check_types(se) 00165 except TypeError as te: self._check_types(te) 00166 00167 def deserialize(self, str): 00168 """ 00169 unpack serialized message in str into this message instance 00170 @param str: byte array of serialized message 00171 @type str: str 00172 """ 00173 try: 00174 if self.header is None: 00175 self.header = std_msgs.msg._Header.Header() 00176 if self.goal_id is None: 00177 self.goal_id = actionlib_msgs.msg.GoalID() 00178 if self.goal is None: 00179 self.goal = head_monitor_msgs.msg.HeadMonitorGoal() 00180 end = 0 00181 _x = self 00182 start = end 00183 end += 12 00184 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00185 start = end 00186 end += 4 00187 (length,) = _struct_I.unpack(str[start:end]) 00188 start = end 00189 end += length 00190 self.header.frame_id = str[start:end] 00191 _x = self 00192 start = end 00193 end += 8 00194 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00195 start = end 00196 end += 4 00197 (length,) = _struct_I.unpack(str[start:end]) 00198 start = end 00199 end += length 00200 self.goal_id.id = str[start:end] 00201 start = end 00202 end += 4 00203 (length,) = _struct_I.unpack(str[start:end]) 00204 start = end 00205 end += length 00206 self.goal.group_name = str[start:end] 00207 _x = self 00208 start = end 00209 end += 12 00210 (_x.goal.joint_trajectory.header.seq, _x.goal.joint_trajectory.header.stamp.secs, _x.goal.joint_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00211 start = end 00212 end += 4 00213 (length,) = _struct_I.unpack(str[start:end]) 00214 start = end 00215 end += length 00216 self.goal.joint_trajectory.header.frame_id = str[start:end] 00217 start = end 00218 end += 4 00219 (length,) = _struct_I.unpack(str[start:end]) 00220 self.goal.joint_trajectory.joint_names = [] 00221 for i in range(0, length): 00222 start = end 00223 end += 4 00224 (length,) = _struct_I.unpack(str[start:end]) 00225 start = end 00226 end += length 00227 val1 = str[start:end] 00228 self.goal.joint_trajectory.joint_names.append(val1) 00229 start = end 00230 end += 4 00231 (length,) = _struct_I.unpack(str[start:end]) 00232 self.goal.joint_trajectory.points = [] 00233 for i in range(0, length): 00234 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00235 start = end 00236 end += 4 00237 (length,) = _struct_I.unpack(str[start:end]) 00238 pattern = '<%sd'%length 00239 start = end 00240 end += struct.calcsize(pattern) 00241 val1.positions = struct.unpack(pattern, str[start:end]) 00242 start = end 00243 end += 4 00244 (length,) = _struct_I.unpack(str[start:end]) 00245 pattern = '<%sd'%length 00246 start = end 00247 end += struct.calcsize(pattern) 00248 val1.velocities = struct.unpack(pattern, str[start:end]) 00249 start = end 00250 end += 4 00251 (length,) = _struct_I.unpack(str[start:end]) 00252 pattern = '<%sd'%length 00253 start = end 00254 end += struct.calcsize(pattern) 00255 val1.accelerations = struct.unpack(pattern, str[start:end]) 00256 _v2 = val1.time_from_start 00257 _x = _v2 00258 start = end 00259 end += 8 00260 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00261 self.goal.joint_trajectory.points.append(val1) 00262 _x = self 00263 start = end 00264 end += 8 00265 (_x.goal.time_offset.secs, _x.goal.time_offset.nsecs,) = _struct_2i.unpack(str[start:end]) 00266 start = end 00267 end += 4 00268 (length,) = _struct_I.unpack(str[start:end]) 00269 start = end 00270 end += length 00271 self.goal.target_link = str[start:end] 00272 return self 00273 except struct.error as e: 00274 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00275 00276 00277 def serialize_numpy(self, buff, numpy): 00278 """ 00279 serialize message with numpy array types into buffer 00280 @param buff: buffer 00281 @type buff: StringIO 00282 @param numpy: numpy python module 00283 @type numpy module 00284 """ 00285 try: 00286 _x = self 00287 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00288 _x = self.header.frame_id 00289 length = len(_x) 00290 buff.write(struct.pack('<I%ss'%length, length, _x)) 00291 _x = self 00292 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00293 _x = self.goal_id.id 00294 length = len(_x) 00295 buff.write(struct.pack('<I%ss'%length, length, _x)) 00296 _x = self.goal.group_name 00297 length = len(_x) 00298 buff.write(struct.pack('<I%ss'%length, length, _x)) 00299 _x = self 00300 buff.write(_struct_3I.pack(_x.goal.joint_trajectory.header.seq, _x.goal.joint_trajectory.header.stamp.secs, _x.goal.joint_trajectory.header.stamp.nsecs)) 00301 _x = self.goal.joint_trajectory.header.frame_id 00302 length = len(_x) 00303 buff.write(struct.pack('<I%ss'%length, length, _x)) 00304 length = len(self.goal.joint_trajectory.joint_names) 00305 buff.write(_struct_I.pack(length)) 00306 for val1 in self.goal.joint_trajectory.joint_names: 00307 length = len(val1) 00308 buff.write(struct.pack('<I%ss'%length, length, val1)) 00309 length = len(self.goal.joint_trajectory.points) 00310 buff.write(_struct_I.pack(length)) 00311 for val1 in self.goal.joint_trajectory.points: 00312 length = len(val1.positions) 00313 buff.write(_struct_I.pack(length)) 00314 pattern = '<%sd'%length 00315 buff.write(val1.positions.tostring()) 00316 length = len(val1.velocities) 00317 buff.write(_struct_I.pack(length)) 00318 pattern = '<%sd'%length 00319 buff.write(val1.velocities.tostring()) 00320 length = len(val1.accelerations) 00321 buff.write(_struct_I.pack(length)) 00322 pattern = '<%sd'%length 00323 buff.write(val1.accelerations.tostring()) 00324 _v3 = val1.time_from_start 00325 _x = _v3 00326 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00327 _x = self 00328 buff.write(_struct_2i.pack(_x.goal.time_offset.secs, _x.goal.time_offset.nsecs)) 00329 _x = self.goal.target_link 00330 length = len(_x) 00331 buff.write(struct.pack('<I%ss'%length, length, _x)) 00332 except struct.error as se: self._check_types(se) 00333 except TypeError as te: self._check_types(te) 00334 00335 def deserialize_numpy(self, str, numpy): 00336 """ 00337 unpack serialized message in str into this message instance using numpy for array types 00338 @param str: byte array of serialized message 00339 @type str: str 00340 @param numpy: numpy python module 00341 @type numpy: module 00342 """ 00343 try: 00344 if self.header is None: 00345 self.header = std_msgs.msg._Header.Header() 00346 if self.goal_id is None: 00347 self.goal_id = actionlib_msgs.msg.GoalID() 00348 if self.goal is None: 00349 self.goal = head_monitor_msgs.msg.HeadMonitorGoal() 00350 end = 0 00351 _x = self 00352 start = end 00353 end += 12 00354 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00355 start = end 00356 end += 4 00357 (length,) = _struct_I.unpack(str[start:end]) 00358 start = end 00359 end += length 00360 self.header.frame_id = str[start:end] 00361 _x = self 00362 start = end 00363 end += 8 00364 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00365 start = end 00366 end += 4 00367 (length,) = _struct_I.unpack(str[start:end]) 00368 start = end 00369 end += length 00370 self.goal_id.id = str[start:end] 00371 start = end 00372 end += 4 00373 (length,) = _struct_I.unpack(str[start:end]) 00374 start = end 00375 end += length 00376 self.goal.group_name = str[start:end] 00377 _x = self 00378 start = end 00379 end += 12 00380 (_x.goal.joint_trajectory.header.seq, _x.goal.joint_trajectory.header.stamp.secs, _x.goal.joint_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00381 start = end 00382 end += 4 00383 (length,) = _struct_I.unpack(str[start:end]) 00384 start = end 00385 end += length 00386 self.goal.joint_trajectory.header.frame_id = str[start:end] 00387 start = end 00388 end += 4 00389 (length,) = _struct_I.unpack(str[start:end]) 00390 self.goal.joint_trajectory.joint_names = [] 00391 for i in range(0, length): 00392 start = end 00393 end += 4 00394 (length,) = _struct_I.unpack(str[start:end]) 00395 start = end 00396 end += length 00397 val1 = str[start:end] 00398 self.goal.joint_trajectory.joint_names.append(val1) 00399 start = end 00400 end += 4 00401 (length,) = _struct_I.unpack(str[start:end]) 00402 self.goal.joint_trajectory.points = [] 00403 for i in range(0, length): 00404 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00405 start = end 00406 end += 4 00407 (length,) = _struct_I.unpack(str[start:end]) 00408 pattern = '<%sd'%length 00409 start = end 00410 end += struct.calcsize(pattern) 00411 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00412 start = end 00413 end += 4 00414 (length,) = _struct_I.unpack(str[start:end]) 00415 pattern = '<%sd'%length 00416 start = end 00417 end += struct.calcsize(pattern) 00418 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00419 start = end 00420 end += 4 00421 (length,) = _struct_I.unpack(str[start:end]) 00422 pattern = '<%sd'%length 00423 start = end 00424 end += struct.calcsize(pattern) 00425 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00426 _v4 = val1.time_from_start 00427 _x = _v4 00428 start = end 00429 end += 8 00430 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00431 self.goal.joint_trajectory.points.append(val1) 00432 _x = self 00433 start = end 00434 end += 8 00435 (_x.goal.time_offset.secs, _x.goal.time_offset.nsecs,) = _struct_2i.unpack(str[start:end]) 00436 start = end 00437 end += 4 00438 (length,) = _struct_I.unpack(str[start:end]) 00439 start = end 00440 end += length 00441 self.goal.target_link = str[start:end] 00442 return self 00443 except struct.error as e: 00444 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00445 00446 _struct_I = roslib.message.struct_I 00447 _struct_3I = struct.Struct("<3I") 00448 _struct_2I = struct.Struct("<2I") 00449 _struct_2i = struct.Struct("<2i")