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


art_msgs
Author(s): Jack O'Quin
autogenerated on Tue Sep 24 2013 10:40:45