00001 """autogenerated by genpy from art_msgs/SteeringDiagnostics.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 std_msgs.msg
00008
00009 class SteeringDiagnostics(genpy.Message):
00010 _md5sum = "5dbe64bbef789e785f8333e897956d94"
00011 _type = "art_msgs/SteeringDiagnostics"
00012 _has_header = True
00013 _full_text = """# ART steering controller diagnostics message
00014
00015 # This message contains data not needed for normal operation of the
00016 # device, but useful for diagnosing problems with it.
00017
00018 # $Id: SteeringDiagnostics.msg 1011 2011-03-03 00:30:42Z jack.oquin $
00019
00020 Header header
00021
00022 int32 encoder # current reported encoder value
00023 int32 last_request # last requested encoder value
00024 int32 center_ticks # initial center encoder value
00025 uint16 status_word # current internal status
00026
00027 ================================================================================
00028 MSG: std_msgs/Header
00029 # Standard metadata for higher-level stamped data types.
00030 # This is generally used to communicate timestamped data
00031 # in a particular coordinate frame.
00032 #
00033 # sequence ID: consecutively increasing ID
00034 uint32 seq
00035 #Two-integer timestamp that is expressed as:
00036 # * stamp.secs: seconds (stamp_secs) since epoch
00037 # * stamp.nsecs: nanoseconds since stamp_secs
00038 # time-handling sugar is provided by the client library
00039 time stamp
00040 #Frame this data is associated with
00041 # 0: no frame
00042 # 1: global frame
00043 string frame_id
00044
00045 """
00046 __slots__ = ['header','encoder','last_request','center_ticks','status_word']
00047 _slot_types = ['std_msgs/Header','int32','int32','int32','uint16']
00048
00049 def __init__(self, *args, **kwds):
00050 """
00051 Constructor. Any message fields that are implicitly/explicitly
00052 set to None will be assigned a default value. The recommend
00053 use is keyword arguments as this is more robust to future message
00054 changes. You cannot mix in-order arguments and keyword arguments.
00055
00056 The available fields are:
00057 header,encoder,last_request,center_ticks,status_word
00058
00059 :param args: complete set of field values, in .msg order
00060 :param kwds: use keyword arguments corresponding to message field names
00061 to set specific fields.
00062 """
00063 if args or kwds:
00064 super(SteeringDiagnostics, self).__init__(*args, **kwds)
00065
00066 if self.header is None:
00067 self.header = std_msgs.msg.Header()
00068 if self.encoder is None:
00069 self.encoder = 0
00070 if self.last_request is None:
00071 self.last_request = 0
00072 if self.center_ticks is None:
00073 self.center_ticks = 0
00074 if self.status_word is None:
00075 self.status_word = 0
00076 else:
00077 self.header = std_msgs.msg.Header()
00078 self.encoder = 0
00079 self.last_request = 0
00080 self.center_ticks = 0
00081 self.status_word = 0
00082
00083 def _get_types(self):
00084 """
00085 internal API method
00086 """
00087 return self._slot_types
00088
00089 def serialize(self, buff):
00090 """
00091 serialize message into buffer
00092 :param buff: buffer, ``StringIO``
00093 """
00094 try:
00095 _x = self
00096 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00097 _x = self.header.frame_id
00098 length = len(_x)
00099 if python3 or type(_x) == unicode:
00100 _x = _x.encode('utf-8')
00101 length = len(_x)
00102 buff.write(struct.pack('<I%ss'%length, length, _x))
00103 _x = self
00104 buff.write(_struct_3iH.pack(_x.encoder, _x.last_request, _x.center_ticks, _x.status_word))
00105 except struct.error as se: self._check_types(se)
00106 except TypeError as te: self._check_types(te)
00107
00108 def deserialize(self, str):
00109 """
00110 unpack serialized message in str into this message instance
00111 :param str: byte array of serialized message, ``str``
00112 """
00113 try:
00114 if self.header is None:
00115 self.header = std_msgs.msg.Header()
00116 end = 0
00117 _x = self
00118 start = end
00119 end += 12
00120 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00121 start = end
00122 end += 4
00123 (length,) = _struct_I.unpack(str[start:end])
00124 start = end
00125 end += length
00126 if python3:
00127 self.header.frame_id = str[start:end].decode('utf-8')
00128 else:
00129 self.header.frame_id = str[start:end]
00130 _x = self
00131 start = end
00132 end += 14
00133 (_x.encoder, _x.last_request, _x.center_ticks, _x.status_word,) = _struct_3iH.unpack(str[start:end])
00134 return self
00135 except struct.error as e:
00136 raise genpy.DeserializationError(e)
00137
00138
00139 def serialize_numpy(self, buff, numpy):
00140 """
00141 serialize message with numpy array types into buffer
00142 :param buff: buffer, ``StringIO``
00143 :param numpy: numpy python module
00144 """
00145 try:
00146 _x = self
00147 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00148 _x = self.header.frame_id
00149 length = len(_x)
00150 if python3 or type(_x) == unicode:
00151 _x = _x.encode('utf-8')
00152 length = len(_x)
00153 buff.write(struct.pack('<I%ss'%length, length, _x))
00154 _x = self
00155 buff.write(_struct_3iH.pack(_x.encoder, _x.last_request, _x.center_ticks, _x.status_word))
00156 except struct.error as se: self._check_types(se)
00157 except TypeError as te: self._check_types(te)
00158
00159 def deserialize_numpy(self, str, numpy):
00160 """
00161 unpack serialized message in str into this message instance using numpy for array types
00162 :param str: byte array of serialized message, ``str``
00163 :param numpy: numpy python module
00164 """
00165 try:
00166 if self.header is None:
00167 self.header = std_msgs.msg.Header()
00168 end = 0
00169 _x = self
00170 start = end
00171 end += 12
00172 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00173 start = end
00174 end += 4
00175 (length,) = _struct_I.unpack(str[start:end])
00176 start = end
00177 end += length
00178 if python3:
00179 self.header.frame_id = str[start:end].decode('utf-8')
00180 else:
00181 self.header.frame_id = str[start:end]
00182 _x = self
00183 start = end
00184 end += 14
00185 (_x.encoder, _x.last_request, _x.center_ticks, _x.status_word,) = _struct_3iH.unpack(str[start:end])
00186 return self
00187 except struct.error as e:
00188 raise genpy.DeserializationError(e)
00189
00190 _struct_I = genpy.struct_I
00191 _struct_3I = struct.Struct("<3I")
00192 _struct_3iH = struct.Struct("<3iH")