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