00001 """autogenerated by genpy from industrial_msgs/RobotStatus.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 industrial_msgs.msg
00008 import std_msgs.msg
00009
00010 class RobotStatus(genpy.Message):
00011 _md5sum = "b733cb45a38101840b75c4c0d6093d19"
00012 _type = "industrial_msgs/RobotStatus"
00013 _has_header = True
00014 _full_text = """# The RobotStatus message contains low level status information
00015 # that is specific to an industrial robot controller
00016
00017 # The header frame ID is not used
00018 Header header
00019
00020 # The robot mode captures the operating mode of the robot. When in
00021 # manual, remote motion is not possible.
00022 industrial_msgs/RobotMode mode
00023
00024 # Estop status: True if robot is e-stopped. The drives are disabled
00025 # and motion is not possible. The e-stop condition must be acknowledged
00026 # and cleared before any motion can begin.
00027 industrial_msgs/TriState e_stopped
00028
00029 # Drive power status: True if drives are powered. Motion commands will
00030 # automatically enable the drives if required. Drive power is not requred
00031 # for possible motion
00032 industrial_msgs/TriState drives_powered
00033
00034 # Motion enabled: Ture if robot motion is possible.
00035 industrial_msgs/TriState motion_possible
00036
00037 # Motion status: True if robot is in motion, otherwise false
00038 industrial_msgs/TriState in_motion
00039
00040 # Error status: True if there is an error condition on the robot. Motion may
00041 # or may not be affected (see motion_possible)
00042 industrial_msgs/TriState in_error
00043
00044 # Error code: Vendor specific error code (non zero indicates error)
00045 int32 error_code
00046
00047 ================================================================================
00048 MSG: std_msgs/Header
00049 # Standard metadata for higher-level stamped data types.
00050 # This is generally used to communicate timestamped data
00051 # in a particular coordinate frame.
00052 #
00053 # sequence ID: consecutively increasing ID
00054 uint32 seq
00055 #Two-integer timestamp that is expressed as:
00056 # * stamp.secs: seconds (stamp_secs) since epoch
00057 # * stamp.nsecs: nanoseconds since stamp_secs
00058 # time-handling sugar is provided by the client library
00059 time stamp
00060 #Frame this data is associated with
00061 # 0: no frame
00062 # 1: global frame
00063 string frame_id
00064
00065 ================================================================================
00066 MSG: industrial_msgs/RobotMode
00067 # The Robot mode message encapsulates the mode/teach state of the robot
00068 # Typically this is controlled by the pendant key switch, but not always
00069
00070 int8 val
00071
00072 # enumerated values
00073 int8 UNKNOWN=-1 # Unknown or unavailable
00074 int8 MANUAL=1 # Teach OR manual mode
00075 int8 AUTO=2 # Automatic mode
00076
00077
00078 ================================================================================
00079 MSG: industrial_msgs/TriState
00080 # The tri-state captures boolean values with the additional state of unknown
00081
00082 int8 val
00083
00084 # enumerated values
00085
00086 # Unknown or unavailable
00087 int8 UNKNOWN=-1
00088
00089 # High state
00090 int8 TRUE=1
00091 int8 ON=1
00092 int8 ENABLED=1
00093 int8 HIGH=1
00094 int8 CLOSED=1
00095
00096 # Low state
00097 int8 FALSE=0
00098 int8 OFF=0
00099 int8 DISABLED=0
00100 int8 LOW=0
00101 int8 OPEN=0
00102
00103
00104 """
00105 __slots__ = ['header','mode','e_stopped','drives_powered','motion_possible','in_motion','in_error','error_code']
00106 _slot_types = ['std_msgs/Header','industrial_msgs/RobotMode','industrial_msgs/TriState','industrial_msgs/TriState','industrial_msgs/TriState','industrial_msgs/TriState','industrial_msgs/TriState','int32']
00107
00108 def __init__(self, *args, **kwds):
00109 """
00110 Constructor. Any message fields that are implicitly/explicitly
00111 set to None will be assigned a default value. The recommend
00112 use is keyword arguments as this is more robust to future message
00113 changes. You cannot mix in-order arguments and keyword arguments.
00114
00115 The available fields are:
00116 header,mode,e_stopped,drives_powered,motion_possible,in_motion,in_error,error_code
00117
00118 :param args: complete set of field values, in .msg order
00119 :param kwds: use keyword arguments corresponding to message field names
00120 to set specific fields.
00121 """
00122 if args or kwds:
00123 super(RobotStatus, self).__init__(*args, **kwds)
00124
00125 if self.header is None:
00126 self.header = std_msgs.msg.Header()
00127 if self.mode is None:
00128 self.mode = industrial_msgs.msg.RobotMode()
00129 if self.e_stopped is None:
00130 self.e_stopped = industrial_msgs.msg.TriState()
00131 if self.drives_powered is None:
00132 self.drives_powered = industrial_msgs.msg.TriState()
00133 if self.motion_possible is None:
00134 self.motion_possible = industrial_msgs.msg.TriState()
00135 if self.in_motion is None:
00136 self.in_motion = industrial_msgs.msg.TriState()
00137 if self.in_error is None:
00138 self.in_error = industrial_msgs.msg.TriState()
00139 if self.error_code is None:
00140 self.error_code = 0
00141 else:
00142 self.header = std_msgs.msg.Header()
00143 self.mode = industrial_msgs.msg.RobotMode()
00144 self.e_stopped = industrial_msgs.msg.TriState()
00145 self.drives_powered = industrial_msgs.msg.TriState()
00146 self.motion_possible = industrial_msgs.msg.TriState()
00147 self.in_motion = industrial_msgs.msg.TriState()
00148 self.in_error = industrial_msgs.msg.TriState()
00149 self.error_code = 0
00150
00151 def _get_types(self):
00152 """
00153 internal API method
00154 """
00155 return self._slot_types
00156
00157 def serialize(self, buff):
00158 """
00159 serialize message into buffer
00160 :param buff: buffer, ``StringIO``
00161 """
00162 try:
00163 _x = self
00164 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00165 _x = self.header.frame_id
00166 length = len(_x)
00167 if python3 or type(_x) == unicode:
00168 _x = _x.encode('utf-8')
00169 length = len(_x)
00170 buff.write(struct.pack('<I%ss'%length, length, _x))
00171 _x = self
00172 buff.write(_struct_6bi.pack(_x.mode.val, _x.e_stopped.val, _x.drives_powered.val, _x.motion_possible.val, _x.in_motion.val, _x.in_error.val, _x.error_code))
00173 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00174 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00175
00176 def deserialize(self, str):
00177 """
00178 unpack serialized message in str into this message instance
00179 :param str: byte array of serialized message, ``str``
00180 """
00181 try:
00182 if self.header is None:
00183 self.header = std_msgs.msg.Header()
00184 if self.mode is None:
00185 self.mode = industrial_msgs.msg.RobotMode()
00186 if self.e_stopped is None:
00187 self.e_stopped = industrial_msgs.msg.TriState()
00188 if self.drives_powered is None:
00189 self.drives_powered = industrial_msgs.msg.TriState()
00190 if self.motion_possible is None:
00191 self.motion_possible = industrial_msgs.msg.TriState()
00192 if self.in_motion is None:
00193 self.in_motion = industrial_msgs.msg.TriState()
00194 if self.in_error is None:
00195 self.in_error = industrial_msgs.msg.TriState()
00196 end = 0
00197 _x = self
00198 start = end
00199 end += 12
00200 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 if python3:
00207 self.header.frame_id = str[start:end].decode('utf-8')
00208 else:
00209 self.header.frame_id = str[start:end]
00210 _x = self
00211 start = end
00212 end += 10
00213 (_x.mode.val, _x.e_stopped.val, _x.drives_powered.val, _x.motion_possible.val, _x.in_motion.val, _x.in_error.val, _x.error_code,) = _struct_6bi.unpack(str[start:end])
00214 return self
00215 except struct.error as e:
00216 raise genpy.DeserializationError(e)
00217
00218
00219 def serialize_numpy(self, buff, numpy):
00220 """
00221 serialize message with numpy array types into buffer
00222 :param buff: buffer, ``StringIO``
00223 :param numpy: numpy python module
00224 """
00225 try:
00226 _x = self
00227 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00228 _x = self.header.frame_id
00229 length = len(_x)
00230 if python3 or type(_x) == unicode:
00231 _x = _x.encode('utf-8')
00232 length = len(_x)
00233 buff.write(struct.pack('<I%ss'%length, length, _x))
00234 _x = self
00235 buff.write(_struct_6bi.pack(_x.mode.val, _x.e_stopped.val, _x.drives_powered.val, _x.motion_possible.val, _x.in_motion.val, _x.in_error.val, _x.error_code))
00236 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00237 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00238
00239 def deserialize_numpy(self, str, numpy):
00240 """
00241 unpack serialized message in str into this message instance using numpy for array types
00242 :param str: byte array of serialized message, ``str``
00243 :param numpy: numpy python module
00244 """
00245 try:
00246 if self.header is None:
00247 self.header = std_msgs.msg.Header()
00248 if self.mode is None:
00249 self.mode = industrial_msgs.msg.RobotMode()
00250 if self.e_stopped is None:
00251 self.e_stopped = industrial_msgs.msg.TriState()
00252 if self.drives_powered is None:
00253 self.drives_powered = industrial_msgs.msg.TriState()
00254 if self.motion_possible is None:
00255 self.motion_possible = industrial_msgs.msg.TriState()
00256 if self.in_motion is None:
00257 self.in_motion = industrial_msgs.msg.TriState()
00258 if self.in_error is None:
00259 self.in_error = industrial_msgs.msg.TriState()
00260 end = 0
00261 _x = self
00262 start = end
00263 end += 12
00264 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00265 start = end
00266 end += 4
00267 (length,) = _struct_I.unpack(str[start:end])
00268 start = end
00269 end += length
00270 if python3:
00271 self.header.frame_id = str[start:end].decode('utf-8')
00272 else:
00273 self.header.frame_id = str[start:end]
00274 _x = self
00275 start = end
00276 end += 10
00277 (_x.mode.val, _x.e_stopped.val, _x.drives_powered.val, _x.motion_possible.val, _x.in_motion.val, _x.in_error.val, _x.error_code,) = _struct_6bi.unpack(str[start:end])
00278 return self
00279 except struct.error as e:
00280 raise genpy.DeserializationError(e)
00281
00282 _struct_I = genpy.struct_I
00283 _struct_3I = struct.Struct("<3I")
00284 _struct_6bi = struct.Struct("<6bi")