_BrakeState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/BrakeState.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 BrakeState(genpy.Message):
00010   _md5sum = "a2cf66ca94ba3a72fab2bbf4fd458de0"
00011   _type = "art_msgs/BrakeState"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """# ART brake controller state message
00014 
00015 # $Id: BrakeState.msg 644 2010-09-28 03:19:07Z jack.oquin $
00016 
00017 Header  header
00018 
00019 float32 position                # fractional position
00020 float32 potentiometer           # potentiometer voltage
00021 float32 encoder                 # encoder reading
00022 float32 pressure                # pressure sensor
00023 
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','position','potentiometer','encoder','pressure']
00045   _slot_types = ['std_msgs/Header','float32','float32','float32','float32']
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,position,potentiometer,encoder,pressure
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(BrakeState, 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()
00066       if self.position is None:
00067         self.position = 0.
00068       if self.potentiometer is None:
00069         self.potentiometer = 0.
00070       if self.encoder is None:
00071         self.encoder = 0.
00072       if self.pressure is None:
00073         self.pressure = 0.
00074     else:
00075       self.header = std_msgs.msg.Header()
00076       self.position = 0.
00077       self.potentiometer = 0.
00078       self.encoder = 0.
00079       self.pressure = 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, ``StringIO``
00091     """
00092     try:
00093       _x = self
00094       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00095       _x = self.header.frame_id
00096       length = len(_x)
00097       if python3 or type(_x) == unicode:
00098         _x = _x.encode('utf-8')
00099         length = len(_x)
00100       buff.write(struct.pack('<I%ss'%length, length, _x))
00101       _x = self
00102       buff.write(_struct_4f.pack(_x.position, _x.potentiometer, _x.encoder, _x.pressure))
00103     except struct.error as se: self._check_types(se)
00104     except TypeError as te: self._check_types(te)
00105 
00106   def deserialize(self, str):
00107     """
00108     unpack serialized message in str into this message instance
00109     :param str: byte array of serialized message, ``str``
00110     """
00111     try:
00112       if self.header is None:
00113         self.header = std_msgs.msg.Header()
00114       end = 0
00115       _x = self
00116       start = end
00117       end += 12
00118       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00119       start = end
00120       end += 4
00121       (length,) = _struct_I.unpack(str[start:end])
00122       start = end
00123       end += length
00124       if python3:
00125         self.header.frame_id = str[start:end].decode('utf-8')
00126       else:
00127         self.header.frame_id = str[start:end]
00128       _x = self
00129       start = end
00130       end += 16
00131       (_x.position, _x.potentiometer, _x.encoder, _x.pressure,) = _struct_4f.unpack(str[start:end])
00132       return self
00133     except struct.error as e:
00134       raise genpy.DeserializationError(e) #most likely buffer underfill
00135 
00136 
00137   def serialize_numpy(self, buff, numpy):
00138     """
00139     serialize message with numpy array types into buffer
00140     :param buff: buffer, ``StringIO``
00141     :param numpy: numpy python module
00142     """
00143     try:
00144       _x = self
00145       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00146       _x = self.header.frame_id
00147       length = len(_x)
00148       if python3 or type(_x) == unicode:
00149         _x = _x.encode('utf-8')
00150         length = len(_x)
00151       buff.write(struct.pack('<I%ss'%length, length, _x))
00152       _x = self
00153       buff.write(_struct_4f.pack(_x.position, _x.potentiometer, _x.encoder, _x.pressure))
00154     except struct.error as se: self._check_types(se)
00155     except TypeError as te: self._check_types(te)
00156 
00157   def deserialize_numpy(self, str, numpy):
00158     """
00159     unpack serialized message in str into this message instance using numpy for array types
00160     :param str: byte array of serialized message, ``str``
00161     :param numpy: numpy python module
00162     """
00163     try:
00164       if self.header is None:
00165         self.header = std_msgs.msg.Header()
00166       end = 0
00167       _x = self
00168       start = end
00169       end += 12
00170       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00171       start = end
00172       end += 4
00173       (length,) = _struct_I.unpack(str[start:end])
00174       start = end
00175       end += length
00176       if python3:
00177         self.header.frame_id = str[start:end].decode('utf-8')
00178       else:
00179         self.header.frame_id = str[start:end]
00180       _x = self
00181       start = end
00182       end += 16
00183       (_x.position, _x.potentiometer, _x.encoder, _x.pressure,) = _struct_4f.unpack(str[start:end])
00184       return self
00185     except struct.error as e:
00186       raise genpy.DeserializationError(e) #most likely buffer underfill
00187 
00188 _struct_I = genpy.struct_I
00189 _struct_4f = struct.Struct("<4f")
00190 _struct_3I = struct.Struct("<3I")


art_msgs
Author(s): Jack O'Quin
autogenerated on Fri Jan 3 2014 11:08:05