00001 """autogenerated by genmsg_py from PilotBehavior.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class PilotBehavior(roslib.message.Message):
00007 _md5sum = "ee280e8dd8b427f32f9742e8b4885525"
00008 _type = "art_msgs/PilotBehavior"
00009 _has_header = False
00010 _full_text = """# ART autonomous vehicle pilot node behaviors.
00011 #
00012 # Normally, the pilot node does Run, continually sending commands to
00013 # the servo device actuators and monitoring their state. With Pause,
00014 # the pilot becomes passive, allowing a learning algorithm or human
00015 # controller direct access to those devices. In the Off state,
00016 # various devices are shut down: the transmission in Park, the brake
00017 # released, the throttle at idle. The engine is not turned off, but
00018 # it could be.
00019
00020 # $Id: PilotBehavior.msg 1539 2011-05-09 04:09:20Z jack.oquin $
00021
00022 # Behavior value
00023 uint8 value
00024
00025 # Behavior numbers:
00026 uint8 Run = 0 # normal driving
00027 uint8 Pause = 1 # stop issuing servo commands
00028 uint8 Off = 2 # turn off devices
00029 uint8 N_behaviors = 3
00030
00031 """
00032
00033 Run = 0
00034 Pause = 1
00035 Off = 2
00036 N_behaviors = 3
00037
00038 __slots__ = ['value']
00039 _slot_types = ['uint8']
00040
00041 def __init__(self, *args, **kwds):
00042 """
00043 Constructor. Any message fields that are implicitly/explicitly
00044 set to None will be assigned a default value. The recommend
00045 use is keyword arguments as this is more robust to future message
00046 changes. You cannot mix in-order arguments and keyword arguments.
00047
00048 The available fields are:
00049 value
00050
00051 @param args: complete set of field values, in .msg order
00052 @param kwds: use keyword arguments corresponding to message field names
00053 to set specific fields.
00054 """
00055 if args or kwds:
00056 super(PilotBehavior, self).__init__(*args, **kwds)
00057
00058 if self.value is None:
00059 self.value = 0
00060 else:
00061 self.value = 0
00062
00063 def _get_types(self):
00064 """
00065 internal API method
00066 """
00067 return self._slot_types
00068
00069 def serialize(self, buff):
00070 """
00071 serialize message into buffer
00072 @param buff: buffer
00073 @type buff: StringIO
00074 """
00075 try:
00076 buff.write(_struct_B.pack(self.value))
00077 except struct.error, se: self._check_types(se)
00078 except TypeError, te: self._check_types(te)
00079
00080 def deserialize(self, str):
00081 """
00082 unpack serialized message in str into this message instance
00083 @param str: byte array of serialized message
00084 @type str: str
00085 """
00086 try:
00087 end = 0
00088 start = end
00089 end += 1
00090 (self.value,) = _struct_B.unpack(str[start:end])
00091 return self
00092 except struct.error, e:
00093 raise roslib.message.DeserializationError(e)
00094
00095
00096 def serialize_numpy(self, buff, numpy):
00097 """
00098 serialize message with numpy array types into buffer
00099 @param buff: buffer
00100 @type buff: StringIO
00101 @param numpy: numpy python module
00102 @type numpy module
00103 """
00104 try:
00105 buff.write(_struct_B.pack(self.value))
00106 except struct.error, se: self._check_types(se)
00107 except TypeError, te: self._check_types(te)
00108
00109 def deserialize_numpy(self, str, numpy):
00110 """
00111 unpack serialized message in str into this message instance using numpy for array types
00112 @param str: byte array of serialized message
00113 @type str: str
00114 @param numpy: numpy python module
00115 @type numpy: module
00116 """
00117 try:
00118 end = 0
00119 start = end
00120 end += 1
00121 (self.value,) = _struct_B.unpack(str[start:end])
00122 return self
00123 except struct.error, e:
00124 raise roslib.message.DeserializationError(e)
00125
00126 _struct_I = roslib.message.struct_I
00127 _struct_B = struct.Struct("<B")