_RoadState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/RoadState.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class RoadState(genpy.Message):
00009   _md5sum = "e033b3ead3b77d2e264d454d67d06e4d"
00010   _type = "art_msgs/RoadState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Navigator Road state values
00013 # $Id: RoadState.msg 615 2010-09-24 16:07:50Z jack.oquin $
00014 
00015 uint16 Init      = 0
00016 uint16 Block     = 1
00017 uint16 Evade     = 2
00018 uint16 Follow    = 3
00019 uint16 Pass      = 4
00020 uint16 Uturn     = 5
00021 uint16 WaitCross = 6
00022 uint16 WaitLane  = 7
00023 uint16 WaitPass  = 8
00024 uint16 WaitStop  = 9
00025 uint16 Zone      = 10
00026 uint16 N_states  = 11
00027 
00028 uint16 state
00029 
00030 """
00031   # Pseudo-constants
00032   Init = 0
00033   Block = 1
00034   Evade = 2
00035   Follow = 3
00036   Pass = 4
00037   Uturn = 5
00038   WaitCross = 6
00039   WaitLane = 7
00040   WaitPass = 8
00041   WaitStop = 9
00042   Zone = 10
00043   N_states = 11
00044 
00045   __slots__ = ['state']
00046   _slot_types = ['uint16']
00047 
00048   def __init__(self, *args, **kwds):
00049     """
00050     Constructor. Any message fields that are implicitly/explicitly
00051     set to None will be assigned a default value. The recommend
00052     use is keyword arguments as this is more robust to future message
00053     changes.  You cannot mix in-order arguments and keyword arguments.
00054 
00055     The available fields are:
00056        state
00057 
00058     :param args: complete set of field values, in .msg order
00059     :param kwds: use keyword arguments corresponding to message field names
00060     to set specific fields.
00061     """
00062     if args or kwds:
00063       super(RoadState, self).__init__(*args, **kwds)
00064       #message fields cannot be None, assign default values for those that are
00065       if self.state is None:
00066         self.state = 0
00067     else:
00068       self.state = 0
00069 
00070   def _get_types(self):
00071     """
00072     internal API method
00073     """
00074     return self._slot_types
00075 
00076   def serialize(self, buff):
00077     """
00078     serialize message into buffer
00079     :param buff: buffer, ``StringIO``
00080     """
00081     try:
00082       buff.write(_struct_H.pack(self.state))
00083     except struct.error as se: self._check_types(se)
00084     except TypeError as te: self._check_types(te)
00085 
00086   def deserialize(self, str):
00087     """
00088     unpack serialized message in str into this message instance
00089     :param str: byte array of serialized message, ``str``
00090     """
00091     try:
00092       end = 0
00093       start = end
00094       end += 2
00095       (self.state,) = _struct_H.unpack(str[start:end])
00096       return self
00097     except struct.error as e:
00098       raise genpy.DeserializationError(e) #most likely buffer underfill
00099 
00100 
00101   def serialize_numpy(self, buff, numpy):
00102     """
00103     serialize message with numpy array types into buffer
00104     :param buff: buffer, ``StringIO``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       buff.write(_struct_H.pack(self.state))
00109     except struct.error as se: self._check_types(se)
00110     except TypeError as te: self._check_types(te)
00111 
00112   def deserialize_numpy(self, str, numpy):
00113     """
00114     unpack serialized message in str into this message instance using numpy for array types
00115     :param str: byte array of serialized message, ``str``
00116     :param numpy: numpy python module
00117     """
00118     try:
00119       end = 0
00120       start = end
00121       end += 2
00122       (self.state,) = _struct_H.unpack(str[start:end])
00123       return self
00124     except struct.error as e:
00125       raise genpy.DeserializationError(e) #most likely buffer underfill
00126 
00127 _struct_I = genpy.struct_I
00128 _struct_H = struct.Struct("<H")


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