00001 """autogenerated by genmsg_py from SafetyStatus.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class SafetyStatus(roslib.message.Message):
00008 _md5sum = "cf78d6042b92d64ebda55641e06d66fa"
00009 _type = "clearpath_base/SafetyStatus"
00010 _has_header = True
00011 _full_text = """Header header
00012 uint16 flags
00013 bool estop
00014 ================================================================================
00015 MSG: std_msgs/Header
00016 # Standard metadata for higher-level stamped data types.
00017 # This is generally used to communicate timestamped data
00018 # in a particular coordinate frame.
00019 #
00020 # sequence ID: consecutively increasing ID
00021 uint32 seq
00022 #Two-integer timestamp that is expressed as:
00023 # * stamp.secs: seconds (stamp_secs) since epoch
00024 # * stamp.nsecs: nanoseconds since stamp_secs
00025 # time-handling sugar is provided by the client library
00026 time stamp
00027 #Frame this data is associated with
00028 # 0: no frame
00029 # 1: global frame
00030 string frame_id
00031
00032 """
00033 __slots__ = ['header','flags','estop']
00034 _slot_types = ['Header','uint16','bool']
00035
00036 def __init__(self, *args, **kwds):
00037 """
00038 Constructor. Any message fields that are implicitly/explicitly
00039 set to None will be assigned a default value. The recommend
00040 use is keyword arguments as this is more robust to future message
00041 changes. You cannot mix in-order arguments and keyword arguments.
00042
00043 The available fields are:
00044 header,flags,estop
00045
00046 @param args: complete set of field values, in .msg order
00047 @param kwds: use keyword arguments corresponding to message field names
00048 to set specific fields.
00049 """
00050 if args or kwds:
00051 super(SafetyStatus, self).__init__(*args, **kwds)
00052
00053 if self.header is None:
00054 self.header = std_msgs.msg._Header.Header()
00055 if self.flags is None:
00056 self.flags = 0
00057 if self.estop is None:
00058 self.estop = False
00059 else:
00060 self.header = std_msgs.msg._Header.Header()
00061 self.flags = 0
00062 self.estop = False
00063
00064 def _get_types(self):
00065 """
00066 internal API method
00067 """
00068 return self._slot_types
00069
00070 def serialize(self, buff):
00071 """
00072 serialize message into buffer
00073 @param buff: buffer
00074 @type buff: StringIO
00075 """
00076 try:
00077 _x = self
00078 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00079 _x = self.header.frame_id
00080 length = len(_x)
00081 buff.write(struct.pack('<I%ss'%length, length, _x))
00082 _x = self
00083 buff.write(_struct_HB.pack(_x.flags, _x.estop))
00084 except struct.error, se: self._check_types(se)
00085 except TypeError, te: self._check_types(te)
00086
00087 def deserialize(self, str):
00088 """
00089 unpack serialized message in str into this message instance
00090 @param str: byte array of serialized message
00091 @type str: str
00092 """
00093 try:
00094 if self.header is None:
00095 self.header = std_msgs.msg._Header.Header()
00096 end = 0
00097 _x = self
00098 start = end
00099 end += 12
00100 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00101 start = end
00102 end += 4
00103 (length,) = _struct_I.unpack(str[start:end])
00104 start = end
00105 end += length
00106 self.header.frame_id = str[start:end]
00107 _x = self
00108 start = end
00109 end += 3
00110 (_x.flags, _x.estop,) = _struct_HB.unpack(str[start:end])
00111 self.estop = bool(self.estop)
00112 return self
00113 except struct.error, e:
00114 raise roslib.message.DeserializationError(e)
00115
00116
00117 def serialize_numpy(self, buff, numpy):
00118 """
00119 serialize message with numpy array types into buffer
00120 @param buff: buffer
00121 @type buff: StringIO
00122 @param numpy: numpy python module
00123 @type numpy module
00124 """
00125 try:
00126 _x = self
00127 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00128 _x = self.header.frame_id
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 _x = self
00132 buff.write(_struct_HB.pack(_x.flags, _x.estop))
00133 except struct.error, se: self._check_types(se)
00134 except TypeError, te: self._check_types(te)
00135
00136 def deserialize_numpy(self, str, numpy):
00137 """
00138 unpack serialized message in str into this message instance using numpy for array types
00139 @param str: byte array of serialized message
00140 @type str: str
00141 @param numpy: numpy python module
00142 @type numpy: module
00143 """
00144 try:
00145 if self.header is None:
00146 self.header = std_msgs.msg._Header.Header()
00147 end = 0
00148 _x = self
00149 start = end
00150 end += 12
00151 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00152 start = end
00153 end += 4
00154 (length,) = _struct_I.unpack(str[start:end])
00155 start = end
00156 end += length
00157 self.header.frame_id = str[start:end]
00158 _x = self
00159 start = end
00160 end += 3
00161 (_x.flags, _x.estop,) = _struct_HB.unpack(str[start:end])
00162 self.estop = bool(self.estop)
00163 return self
00164 except struct.error, e:
00165 raise roslib.message.DeserializationError(e)
00166
00167 _struct_I = roslib.message.struct_I
00168 _struct_HB = struct.Struct("<HB")
00169 _struct_3I = struct.Struct("<3I")