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