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