$search
00001 """autogenerated by genmsg_py from SteeringDiagnostics.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class SteeringDiagnostics(roslib.message.Message): 00008 _md5sum = "5dbe64bbef789e785f8333e897956d94" 00009 _type = "art_msgs/SteeringDiagnostics" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """# ART steering controller diagnostics message 00012 00013 # This message contains data not needed for normal operation of the 00014 # device, but useful for diagnosing problems with it. 00015 00016 # $Id: SteeringDiagnostics.msg 1011 2011-03-03 00:30:42Z jack.oquin $ 00017 00018 Header header 00019 00020 int32 encoder # current reported encoder value 00021 int32 last_request # last requested encoder value 00022 int32 center_ticks # initial center encoder value 00023 uint16 status_word # current internal status 00024 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 __slots__ = ['header','encoder','last_request','center_ticks','status_word'] 00045 _slot_types = ['Header','int32','int32','int32','uint16'] 00046 00047 def __init__(self, *args, **kwds): 00048 """ 00049 Constructor. Any message fields that are implicitly/explicitly 00050 set to None will be assigned a default value. The recommend 00051 use is keyword arguments as this is more robust to future message 00052 changes. You cannot mix in-order arguments and keyword arguments. 00053 00054 The available fields are: 00055 header,encoder,last_request,center_ticks,status_word 00056 00057 @param args: complete set of field values, in .msg order 00058 @param kwds: use keyword arguments corresponding to message field names 00059 to set specific fields. 00060 """ 00061 if args or kwds: 00062 super(SteeringDiagnostics, self).__init__(*args, **kwds) 00063 #message fields cannot be None, assign default values for those that are 00064 if self.header is None: 00065 self.header = std_msgs.msg._Header.Header() 00066 if self.encoder is None: 00067 self.encoder = 0 00068 if self.last_request is None: 00069 self.last_request = 0 00070 if self.center_ticks is None: 00071 self.center_ticks = 0 00072 if self.status_word is None: 00073 self.status_word = 0 00074 else: 00075 self.header = std_msgs.msg._Header.Header() 00076 self.encoder = 0 00077 self.last_request = 0 00078 self.center_ticks = 0 00079 self.status_word = 0 00080 00081 def _get_types(self): 00082 """ 00083 internal API method 00084 """ 00085 return self._slot_types 00086 00087 def serialize(self, buff): 00088 """ 00089 serialize message into buffer 00090 @param buff: buffer 00091 @type buff: StringIO 00092 """ 00093 try: 00094 _x = self 00095 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00096 _x = self.header.frame_id 00097 length = len(_x) 00098 buff.write(struct.pack('<I%ss'%length, length, _x)) 00099 _x = self 00100 buff.write(_struct_3iH.pack(_x.encoder, _x.last_request, _x.center_ticks, _x.status_word)) 00101 except struct.error as se: self._check_types(se) 00102 except TypeError as te: self._check_types(te) 00103 00104 def deserialize(self, str): 00105 """ 00106 unpack serialized message in str into this message instance 00107 @param str: byte array of serialized message 00108 @type str: str 00109 """ 00110 try: 00111 if self.header is None: 00112 self.header = std_msgs.msg._Header.Header() 00113 end = 0 00114 _x = self 00115 start = end 00116 end += 12 00117 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00118 start = end 00119 end += 4 00120 (length,) = _struct_I.unpack(str[start:end]) 00121 start = end 00122 end += length 00123 self.header.frame_id = str[start:end] 00124 _x = self 00125 start = end 00126 end += 14 00127 (_x.encoder, _x.last_request, _x.center_ticks, _x.status_word,) = _struct_3iH.unpack(str[start:end]) 00128 return self 00129 except struct.error as e: 00130 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00131 00132 00133 def serialize_numpy(self, buff, numpy): 00134 """ 00135 serialize message with numpy array types into buffer 00136 @param buff: buffer 00137 @type buff: StringIO 00138 @param numpy: numpy python module 00139 @type numpy module 00140 """ 00141 try: 00142 _x = self 00143 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00144 _x = self.header.frame_id 00145 length = len(_x) 00146 buff.write(struct.pack('<I%ss'%length, length, _x)) 00147 _x = self 00148 buff.write(_struct_3iH.pack(_x.encoder, _x.last_request, _x.center_ticks, _x.status_word)) 00149 except struct.error as se: self._check_types(se) 00150 except TypeError as te: self._check_types(te) 00151 00152 def deserialize_numpy(self, str, numpy): 00153 """ 00154 unpack serialized message in str into this message instance using numpy for array types 00155 @param str: byte array of serialized message 00156 @type str: str 00157 @param numpy: numpy python module 00158 @type numpy: module 00159 """ 00160 try: 00161 if self.header is None: 00162 self.header = std_msgs.msg._Header.Header() 00163 end = 0 00164 _x = self 00165 start = end 00166 end += 12 00167 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00168 start = end 00169 end += 4 00170 (length,) = _struct_I.unpack(str[start:end]) 00171 start = end 00172 end += length 00173 self.header.frame_id = str[start:end] 00174 _x = self 00175 start = end 00176 end += 14 00177 (_x.encoder, _x.last_request, _x.center_ticks, _x.status_word,) = _struct_3iH.unpack(str[start:end]) 00178 return self 00179 except struct.error as e: 00180 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00181 00182 _struct_I = roslib.message.struct_I 00183 _struct_3I = struct.Struct("<3I") 00184 _struct_3iH = struct.Struct("<3iH")