$search
00001 """autogenerated by genmsg_py from HeadMonitorResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import trajectory_msgs.msg 00006 import arm_navigation_msgs.msg 00007 import roslib.rostime 00008 import std_msgs.msg 00009 00010 class HeadMonitorResult(roslib.message.Message): 00011 _md5sum = "2222f057b77c8d4ea3a6f92caeb86806" 00012 _type = "head_monitor_msgs/HeadMonitorResult" 00013 _has_header = False #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 trajectory_msgs/JointTrajectory actual_trajectory 00016 arm_navigation_msgs/ArmNavigationErrorCodes error_code 00017 00018 ================================================================================ 00019 MSG: trajectory_msgs/JointTrajectory 00020 Header header 00021 string[] joint_names 00022 JointTrajectoryPoint[] points 00023 ================================================================================ 00024 MSG: std_msgs/Header 00025 # Standard metadata for higher-level stamped data types. 00026 # This is generally used to communicate timestamped data 00027 # in a particular coordinate frame. 00028 # 00029 # sequence ID: consecutively increasing ID 00030 uint32 seq 00031 #Two-integer timestamp that is expressed as: 00032 # * stamp.secs: seconds (stamp_secs) since epoch 00033 # * stamp.nsecs: nanoseconds since stamp_secs 00034 # time-handling sugar is provided by the client library 00035 time stamp 00036 #Frame this data is associated with 00037 # 0: no frame 00038 # 1: global frame 00039 string frame_id 00040 00041 ================================================================================ 00042 MSG: trajectory_msgs/JointTrajectoryPoint 00043 float64[] positions 00044 float64[] velocities 00045 float64[] accelerations 00046 duration time_from_start 00047 ================================================================================ 00048 MSG: arm_navigation_msgs/ArmNavigationErrorCodes 00049 int32 val 00050 00051 # overall behavior 00052 int32 PLANNING_FAILED=-1 00053 int32 SUCCESS=1 00054 int32 TIMED_OUT=-2 00055 00056 # start state errors 00057 int32 START_STATE_IN_COLLISION=-3 00058 int32 START_STATE_VIOLATES_PATH_CONSTRAINTS=-4 00059 00060 # goal errors 00061 int32 GOAL_IN_COLLISION=-5 00062 int32 GOAL_VIOLATES_PATH_CONSTRAINTS=-6 00063 00064 # robot state 00065 int32 INVALID_ROBOT_STATE=-7 00066 int32 INCOMPLETE_ROBOT_STATE=-8 00067 00068 # planning request errors 00069 int32 INVALID_PLANNER_ID=-9 00070 int32 INVALID_NUM_PLANNING_ATTEMPTS=-10 00071 int32 INVALID_ALLOWED_PLANNING_TIME=-11 00072 int32 INVALID_GROUP_NAME=-12 00073 int32 INVALID_GOAL_JOINT_CONSTRAINTS=-13 00074 int32 INVALID_GOAL_POSITION_CONSTRAINTS=-14 00075 int32 INVALID_GOAL_ORIENTATION_CONSTRAINTS=-15 00076 int32 INVALID_PATH_JOINT_CONSTRAINTS=-16 00077 int32 INVALID_PATH_POSITION_CONSTRAINTS=-17 00078 int32 INVALID_PATH_ORIENTATION_CONSTRAINTS=-18 00079 00080 # state/trajectory monitor errors 00081 int32 INVALID_TRAJECTORY=-19 00082 int32 INVALID_INDEX=-20 00083 int32 JOINT_LIMITS_VIOLATED=-21 00084 int32 PATH_CONSTRAINTS_VIOLATED=-22 00085 int32 COLLISION_CONSTRAINTS_VIOLATED=-23 00086 int32 GOAL_CONSTRAINTS_VIOLATED=-24 00087 int32 JOINTS_NOT_MOVING=-25 00088 int32 TRAJECTORY_CONTROLLER_FAILED=-26 00089 00090 # system errors 00091 int32 FRAME_TRANSFORM_FAILURE=-27 00092 int32 COLLISION_CHECKING_UNAVAILABLE=-28 00093 int32 ROBOT_STATE_STALE=-29 00094 int32 SENSOR_INFO_STALE=-30 00095 00096 # kinematics errors 00097 int32 NO_IK_SOLUTION=-31 00098 int32 INVALID_LINK_NAME=-32 00099 int32 IK_LINK_IN_COLLISION=-33 00100 int32 NO_FK_SOLUTION=-34 00101 int32 KINEMATICS_STATE_IN_COLLISION=-35 00102 00103 # general errors 00104 int32 INVALID_TIMEOUT=-36 00105 00106 00107 """ 00108 __slots__ = ['actual_trajectory','error_code'] 00109 _slot_types = ['trajectory_msgs/JointTrajectory','arm_navigation_msgs/ArmNavigationErrorCodes'] 00110 00111 def __init__(self, *args, **kwds): 00112 """ 00113 Constructor. Any message fields that are implicitly/explicitly 00114 set to None will be assigned a default value. The recommend 00115 use is keyword arguments as this is more robust to future message 00116 changes. You cannot mix in-order arguments and keyword arguments. 00117 00118 The available fields are: 00119 actual_trajectory,error_code 00120 00121 @param args: complete set of field values, in .msg order 00122 @param kwds: use keyword arguments corresponding to message field names 00123 to set specific fields. 00124 """ 00125 if args or kwds: 00126 super(HeadMonitorResult, self).__init__(*args, **kwds) 00127 #message fields cannot be None, assign default values for those that are 00128 if self.actual_trajectory is None: 00129 self.actual_trajectory = trajectory_msgs.msg.JointTrajectory() 00130 if self.error_code is None: 00131 self.error_code = arm_navigation_msgs.msg.ArmNavigationErrorCodes() 00132 else: 00133 self.actual_trajectory = trajectory_msgs.msg.JointTrajectory() 00134 self.error_code = arm_navigation_msgs.msg.ArmNavigationErrorCodes() 00135 00136 def _get_types(self): 00137 """ 00138 internal API method 00139 """ 00140 return self._slot_types 00141 00142 def serialize(self, buff): 00143 """ 00144 serialize message into buffer 00145 @param buff: buffer 00146 @type buff: StringIO 00147 """ 00148 try: 00149 _x = self 00150 buff.write(_struct_3I.pack(_x.actual_trajectory.header.seq, _x.actual_trajectory.header.stamp.secs, _x.actual_trajectory.header.stamp.nsecs)) 00151 _x = self.actual_trajectory.header.frame_id 00152 length = len(_x) 00153 buff.write(struct.pack('<I%ss'%length, length, _x)) 00154 length = len(self.actual_trajectory.joint_names) 00155 buff.write(_struct_I.pack(length)) 00156 for val1 in self.actual_trajectory.joint_names: 00157 length = len(val1) 00158 buff.write(struct.pack('<I%ss'%length, length, val1)) 00159 length = len(self.actual_trajectory.points) 00160 buff.write(_struct_I.pack(length)) 00161 for val1 in self.actual_trajectory.points: 00162 length = len(val1.positions) 00163 buff.write(_struct_I.pack(length)) 00164 pattern = '<%sd'%length 00165 buff.write(struct.pack(pattern, *val1.positions)) 00166 length = len(val1.velocities) 00167 buff.write(_struct_I.pack(length)) 00168 pattern = '<%sd'%length 00169 buff.write(struct.pack(pattern, *val1.velocities)) 00170 length = len(val1.accelerations) 00171 buff.write(_struct_I.pack(length)) 00172 pattern = '<%sd'%length 00173 buff.write(struct.pack(pattern, *val1.accelerations)) 00174 _v1 = val1.time_from_start 00175 _x = _v1 00176 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00177 buff.write(_struct_i.pack(self.error_code.val)) 00178 except struct.error as se: self._check_types(se) 00179 except TypeError as te: self._check_types(te) 00180 00181 def deserialize(self, str): 00182 """ 00183 unpack serialized message in str into this message instance 00184 @param str: byte array of serialized message 00185 @type str: str 00186 """ 00187 try: 00188 if self.actual_trajectory is None: 00189 self.actual_trajectory = trajectory_msgs.msg.JointTrajectory() 00190 if self.error_code is None: 00191 self.error_code = arm_navigation_msgs.msg.ArmNavigationErrorCodes() 00192 end = 0 00193 _x = self 00194 start = end 00195 end += 12 00196 (_x.actual_trajectory.header.seq, _x.actual_trajectory.header.stamp.secs, _x.actual_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00197 start = end 00198 end += 4 00199 (length,) = _struct_I.unpack(str[start:end]) 00200 start = end 00201 end += length 00202 self.actual_trajectory.header.frame_id = str[start:end] 00203 start = end 00204 end += 4 00205 (length,) = _struct_I.unpack(str[start:end]) 00206 self.actual_trajectory.joint_names = [] 00207 for i in range(0, length): 00208 start = end 00209 end += 4 00210 (length,) = _struct_I.unpack(str[start:end]) 00211 start = end 00212 end += length 00213 val1 = str[start:end] 00214 self.actual_trajectory.joint_names.append(val1) 00215 start = end 00216 end += 4 00217 (length,) = _struct_I.unpack(str[start:end]) 00218 self.actual_trajectory.points = [] 00219 for i in range(0, length): 00220 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00221 start = end 00222 end += 4 00223 (length,) = _struct_I.unpack(str[start:end]) 00224 pattern = '<%sd'%length 00225 start = end 00226 end += struct.calcsize(pattern) 00227 val1.positions = struct.unpack(pattern, str[start:end]) 00228 start = end 00229 end += 4 00230 (length,) = _struct_I.unpack(str[start:end]) 00231 pattern = '<%sd'%length 00232 start = end 00233 end += struct.calcsize(pattern) 00234 val1.velocities = struct.unpack(pattern, str[start:end]) 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.accelerations = struct.unpack(pattern, str[start:end]) 00242 _v2 = val1.time_from_start 00243 _x = _v2 00244 start = end 00245 end += 8 00246 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00247 self.actual_trajectory.points.append(val1) 00248 start = end 00249 end += 4 00250 (self.error_code.val,) = _struct_i.unpack(str[start:end]) 00251 return self 00252 except struct.error as e: 00253 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00254 00255 00256 def serialize_numpy(self, buff, numpy): 00257 """ 00258 serialize message with numpy array types into buffer 00259 @param buff: buffer 00260 @type buff: StringIO 00261 @param numpy: numpy python module 00262 @type numpy module 00263 """ 00264 try: 00265 _x = self 00266 buff.write(_struct_3I.pack(_x.actual_trajectory.header.seq, _x.actual_trajectory.header.stamp.secs, _x.actual_trajectory.header.stamp.nsecs)) 00267 _x = self.actual_trajectory.header.frame_id 00268 length = len(_x) 00269 buff.write(struct.pack('<I%ss'%length, length, _x)) 00270 length = len(self.actual_trajectory.joint_names) 00271 buff.write(_struct_I.pack(length)) 00272 for val1 in self.actual_trajectory.joint_names: 00273 length = len(val1) 00274 buff.write(struct.pack('<I%ss'%length, length, val1)) 00275 length = len(self.actual_trajectory.points) 00276 buff.write(_struct_I.pack(length)) 00277 for val1 in self.actual_trajectory.points: 00278 length = len(val1.positions) 00279 buff.write(_struct_I.pack(length)) 00280 pattern = '<%sd'%length 00281 buff.write(val1.positions.tostring()) 00282 length = len(val1.velocities) 00283 buff.write(_struct_I.pack(length)) 00284 pattern = '<%sd'%length 00285 buff.write(val1.velocities.tostring()) 00286 length = len(val1.accelerations) 00287 buff.write(_struct_I.pack(length)) 00288 pattern = '<%sd'%length 00289 buff.write(val1.accelerations.tostring()) 00290 _v3 = val1.time_from_start 00291 _x = _v3 00292 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00293 buff.write(_struct_i.pack(self.error_code.val)) 00294 except struct.error as se: self._check_types(se) 00295 except TypeError as te: self._check_types(te) 00296 00297 def deserialize_numpy(self, str, numpy): 00298 """ 00299 unpack serialized message in str into this message instance using numpy for array types 00300 @param str: byte array of serialized message 00301 @type str: str 00302 @param numpy: numpy python module 00303 @type numpy: module 00304 """ 00305 try: 00306 if self.actual_trajectory is None: 00307 self.actual_trajectory = trajectory_msgs.msg.JointTrajectory() 00308 if self.error_code is None: 00309 self.error_code = arm_navigation_msgs.msg.ArmNavigationErrorCodes() 00310 end = 0 00311 _x = self 00312 start = end 00313 end += 12 00314 (_x.actual_trajectory.header.seq, _x.actual_trajectory.header.stamp.secs, _x.actual_trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00315 start = end 00316 end += 4 00317 (length,) = _struct_I.unpack(str[start:end]) 00318 start = end 00319 end += length 00320 self.actual_trajectory.header.frame_id = str[start:end] 00321 start = end 00322 end += 4 00323 (length,) = _struct_I.unpack(str[start:end]) 00324 self.actual_trajectory.joint_names = [] 00325 for i in range(0, length): 00326 start = end 00327 end += 4 00328 (length,) = _struct_I.unpack(str[start:end]) 00329 start = end 00330 end += length 00331 val1 = str[start:end] 00332 self.actual_trajectory.joint_names.append(val1) 00333 start = end 00334 end += 4 00335 (length,) = _struct_I.unpack(str[start:end]) 00336 self.actual_trajectory.points = [] 00337 for i in range(0, length): 00338 val1 = trajectory_msgs.msg.JointTrajectoryPoint() 00339 start = end 00340 end += 4 00341 (length,) = _struct_I.unpack(str[start:end]) 00342 pattern = '<%sd'%length 00343 start = end 00344 end += struct.calcsize(pattern) 00345 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00346 start = end 00347 end += 4 00348 (length,) = _struct_I.unpack(str[start:end]) 00349 pattern = '<%sd'%length 00350 start = end 00351 end += struct.calcsize(pattern) 00352 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00353 start = end 00354 end += 4 00355 (length,) = _struct_I.unpack(str[start:end]) 00356 pattern = '<%sd'%length 00357 start = end 00358 end += struct.calcsize(pattern) 00359 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00360 _v4 = val1.time_from_start 00361 _x = _v4 00362 start = end 00363 end += 8 00364 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00365 self.actual_trajectory.points.append(val1) 00366 start = end 00367 end += 4 00368 (self.error_code.val,) = _struct_i.unpack(str[start:end]) 00369 return self 00370 except struct.error as e: 00371 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00372 00373 _struct_I = roslib.message.struct_I 00374 _struct_i = struct.Struct("<i") 00375 _struct_3I = struct.Struct("<3I") 00376 _struct_2i = struct.Struct("<2i")