_SteeringState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/SteeringState.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 art_msgs.msg
00008 import std_msgs.msg
00009 
00010 class SteeringState(genpy.Message):
00011   _md5sum = "7bf11da138f80579d285d99bea47f6d3"
00012   _type = "art_msgs/SteeringState"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """# ART steering controller state message
00015 
00016 # $Id: SteeringState.msg 1161 2011-03-26 02:10:49Z jack.oquin $
00017 
00018 Header  header
00019 
00020 DriverState driver              # driver state
00021 float32 angle                   # steering angle in degrees
00022 float32 sensor                  # steering sensor voltage
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 MSG: art_msgs/DriverState
00045 # ART driver states -- similar to those in driver_base.
00046 
00047 # $Id: DriverState.msg 1161 2011-03-26 02:10:49Z jack.oquin $
00048 
00049 # constants
00050 uint32 CLOSED = 0       # Not connected to the hardware
00051 uint32 OPENED = 1       # Passively connected to the hardware
00052 uint32 RUNNING = 2      # Sending hardware commands
00053 
00054 uint32 state
00055 
00056 """
00057   __slots__ = ['header','driver','angle','sensor']
00058   _slot_types = ['std_msgs/Header','art_msgs/DriverState','float32','float32']
00059 
00060   def __init__(self, *args, **kwds):
00061     """
00062     Constructor. Any message fields that are implicitly/explicitly
00063     set to None will be assigned a default value. The recommend
00064     use is keyword arguments as this is more robust to future message
00065     changes.  You cannot mix in-order arguments and keyword arguments.
00066 
00067     The available fields are:
00068        header,driver,angle,sensor
00069 
00070     :param args: complete set of field values, in .msg order
00071     :param kwds: use keyword arguments corresponding to message field names
00072     to set specific fields.
00073     """
00074     if args or kwds:
00075       super(SteeringState, self).__init__(*args, **kwds)
00076       #message fields cannot be None, assign default values for those that are
00077       if self.header is None:
00078         self.header = std_msgs.msg.Header()
00079       if self.driver is None:
00080         self.driver = art_msgs.msg.DriverState()
00081       if self.angle is None:
00082         self.angle = 0.
00083       if self.sensor is None:
00084         self.sensor = 0.
00085     else:
00086       self.header = std_msgs.msg.Header()
00087       self.driver = art_msgs.msg.DriverState()
00088       self.angle = 0.
00089       self.sensor = 0.
00090 
00091   def _get_types(self):
00092     """
00093     internal API method
00094     """
00095     return self._slot_types
00096 
00097   def serialize(self, buff):
00098     """
00099     serialize message into buffer
00100     :param buff: buffer, ``StringIO``
00101     """
00102     try:
00103       _x = self
00104       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00105       _x = self.header.frame_id
00106       length = len(_x)
00107       if python3 or type(_x) == unicode:
00108         _x = _x.encode('utf-8')
00109         length = len(_x)
00110       buff.write(struct.pack('<I%ss'%length, length, _x))
00111       _x = self
00112       buff.write(_struct_I2f.pack(_x.driver.state, _x.angle, _x.sensor))
00113     except struct.error as se: self._check_types(se)
00114     except TypeError as te: self._check_types(te)
00115 
00116   def deserialize(self, str):
00117     """
00118     unpack serialized message in str into this message instance
00119     :param str: byte array of serialized message, ``str``
00120     """
00121     try:
00122       if self.header is None:
00123         self.header = std_msgs.msg.Header()
00124       if self.driver is None:
00125         self.driver = art_msgs.msg.DriverState()
00126       end = 0
00127       _x = self
00128       start = end
00129       end += 12
00130       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00131       start = end
00132       end += 4
00133       (length,) = _struct_I.unpack(str[start:end])
00134       start = end
00135       end += length
00136       if python3:
00137         self.header.frame_id = str[start:end].decode('utf-8')
00138       else:
00139         self.header.frame_id = str[start:end]
00140       _x = self
00141       start = end
00142       end += 12
00143       (_x.driver.state, _x.angle, _x.sensor,) = _struct_I2f.unpack(str[start:end])
00144       return self
00145     except struct.error as e:
00146       raise genpy.DeserializationError(e) #most likely buffer underfill
00147 
00148 
00149   def serialize_numpy(self, buff, numpy):
00150     """
00151     serialize message with numpy array types into buffer
00152     :param buff: buffer, ``StringIO``
00153     :param numpy: numpy python module
00154     """
00155     try:
00156       _x = self
00157       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00158       _x = self.header.frame_id
00159       length = len(_x)
00160       if python3 or type(_x) == unicode:
00161         _x = _x.encode('utf-8')
00162         length = len(_x)
00163       buff.write(struct.pack('<I%ss'%length, length, _x))
00164       _x = self
00165       buff.write(_struct_I2f.pack(_x.driver.state, _x.angle, _x.sensor))
00166     except struct.error as se: self._check_types(se)
00167     except TypeError as te: self._check_types(te)
00168 
00169   def deserialize_numpy(self, str, numpy):
00170     """
00171     unpack serialized message in str into this message instance using numpy for array types
00172     :param str: byte array of serialized message, ``str``
00173     :param numpy: numpy python module
00174     """
00175     try:
00176       if self.header is None:
00177         self.header = std_msgs.msg.Header()
00178       if self.driver is None:
00179         self.driver = art_msgs.msg.DriverState()
00180       end = 0
00181       _x = self
00182       start = end
00183       end += 12
00184       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00185       start = end
00186       end += 4
00187       (length,) = _struct_I.unpack(str[start:end])
00188       start = end
00189       end += length
00190       if python3:
00191         self.header.frame_id = str[start:end].decode('utf-8')
00192       else:
00193         self.header.frame_id = str[start:end]
00194       _x = self
00195       start = end
00196       end += 12
00197       (_x.driver.state, _x.angle, _x.sensor,) = _struct_I2f.unpack(str[start:end])
00198       return self
00199     except struct.error as e:
00200       raise genpy.DeserializationError(e) #most likely buffer underfill
00201 
00202 _struct_I = genpy.struct_I
00203 _struct_3I = struct.Struct("<3I")
00204 _struct_I2f = struct.Struct("<I2f")


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