_BehaviorRequest.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_behavior_manager/BehaviorRequestRequest.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 BehaviorRequestRequest(genpy.Message):
00009   _md5sum = "17797762e222a7e449a42dfc791a2563"
00010   _type = "hrl_behavior_manager/BehaviorRequestRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 priority
00013 string behavior_name
00014 
00015 """
00016   __slots__ = ['priority','behavior_name']
00017   _slot_types = ['uint8','string']
00018 
00019   def __init__(self, *args, **kwds):
00020     """
00021     Constructor. Any message fields that are implicitly/explicitly
00022     set to None will be assigned a default value. The recommend
00023     use is keyword arguments as this is more robust to future message
00024     changes.  You cannot mix in-order arguments and keyword arguments.
00025 
00026     The available fields are:
00027        priority,behavior_name
00028 
00029     :param args: complete set of field values, in .msg order
00030     :param kwds: use keyword arguments corresponding to message field names
00031     to set specific fields.
00032     """
00033     if args or kwds:
00034       super(BehaviorRequestRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.priority is None:
00037         self.priority = 0
00038       if self.behavior_name is None:
00039         self.behavior_name = ''
00040     else:
00041       self.priority = 0
00042       self.behavior_name = ''
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       buff.write(_struct_B.pack(self.priority))
00057       _x = self.behavior_name
00058       length = len(_x)
00059       if python3 or type(_x) == unicode:
00060         _x = _x.encode('utf-8')
00061         length = len(_x)
00062       buff.write(struct.pack('<I%ss'%length, length, _x))
00063     except struct.error as se: self._check_types(se)
00064     except TypeError as te: self._check_types(te)
00065 
00066   def deserialize(self, str):
00067     """
00068     unpack serialized message in str into this message instance
00069     :param str: byte array of serialized message, ``str``
00070     """
00071     try:
00072       end = 0
00073       start = end
00074       end += 1
00075       (self.priority,) = _struct_B.unpack(str[start:end])
00076       start = end
00077       end += 4
00078       (length,) = _struct_I.unpack(str[start:end])
00079       start = end
00080       end += length
00081       if python3:
00082         self.behavior_name = str[start:end].decode('utf-8')
00083       else:
00084         self.behavior_name = str[start:end]
00085       return self
00086     except struct.error as e:
00087       raise genpy.DeserializationError(e) #most likely buffer underfill
00088 
00089 
00090   def serialize_numpy(self, buff, numpy):
00091     """
00092     serialize message with numpy array types into buffer
00093     :param buff: buffer, ``StringIO``
00094     :param numpy: numpy python module
00095     """
00096     try:
00097       buff.write(_struct_B.pack(self.priority))
00098       _x = self.behavior_name
00099       length = len(_x)
00100       if python3 or type(_x) == unicode:
00101         _x = _x.encode('utf-8')
00102         length = len(_x)
00103       buff.write(struct.pack('<I%ss'%length, length, _x))
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.priority,) = _struct_B.unpack(str[start:end])
00118       start = end
00119       end += 4
00120       (length,) = _struct_I.unpack(str[start:end])
00121       start = end
00122       end += length
00123       if python3:
00124         self.behavior_name = str[start:end].decode('utf-8')
00125       else:
00126         self.behavior_name = str[start:end]
00127       return self
00128     except struct.error as e:
00129       raise genpy.DeserializationError(e) #most likely buffer underfill
00130 
00131 _struct_I = genpy.struct_I
00132 _struct_B = struct.Struct("<B")
00133 """autogenerated by genpy from hrl_behavior_manager/BehaviorRequestResponse.msg. Do not edit."""
00134 import sys
00135 python3 = True if sys.hexversion > 0x03000000 else False
00136 import genpy
00137 import struct
00138 
00139 
00140 class BehaviorRequestResponse(genpy.Message):
00141   _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15"
00142   _type = "hrl_behavior_manager/BehaviorRequestResponse"
00143   _has_header = False #flag to mark the presence of a Header object
00144   _full_text = """bool success
00145 
00146 
00147 """
00148   __slots__ = ['success']
00149   _slot_types = ['bool']
00150 
00151   def __init__(self, *args, **kwds):
00152     """
00153     Constructor. Any message fields that are implicitly/explicitly
00154     set to None will be assigned a default value. The recommend
00155     use is keyword arguments as this is more robust to future message
00156     changes.  You cannot mix in-order arguments and keyword arguments.
00157 
00158     The available fields are:
00159        success
00160 
00161     :param args: complete set of field values, in .msg order
00162     :param kwds: use keyword arguments corresponding to message field names
00163     to set specific fields.
00164     """
00165     if args or kwds:
00166       super(BehaviorRequestResponse, self).__init__(*args, **kwds)
00167       #message fields cannot be None, assign default values for those that are
00168       if self.success is None:
00169         self.success = False
00170     else:
00171       self.success = False
00172 
00173   def _get_types(self):
00174     """
00175     internal API method
00176     """
00177     return self._slot_types
00178 
00179   def serialize(self, buff):
00180     """
00181     serialize message into buffer
00182     :param buff: buffer, ``StringIO``
00183     """
00184     try:
00185       buff.write(_struct_B.pack(self.success))
00186     except struct.error as se: self._check_types(se)
00187     except TypeError as te: self._check_types(te)
00188 
00189   def deserialize(self, str):
00190     """
00191     unpack serialized message in str into this message instance
00192     :param str: byte array of serialized message, ``str``
00193     """
00194     try:
00195       end = 0
00196       start = end
00197       end += 1
00198       (self.success,) = _struct_B.unpack(str[start:end])
00199       self.success = bool(self.success)
00200       return self
00201     except struct.error as e:
00202       raise genpy.DeserializationError(e) #most likely buffer underfill
00203 
00204 
00205   def serialize_numpy(self, buff, numpy):
00206     """
00207     serialize message with numpy array types into buffer
00208     :param buff: buffer, ``StringIO``
00209     :param numpy: numpy python module
00210     """
00211     try:
00212       buff.write(_struct_B.pack(self.success))
00213     except struct.error as se: self._check_types(se)
00214     except TypeError as te: self._check_types(te)
00215 
00216   def deserialize_numpy(self, str, numpy):
00217     """
00218     unpack serialized message in str into this message instance using numpy for array types
00219     :param str: byte array of serialized message, ``str``
00220     :param numpy: numpy python module
00221     """
00222     try:
00223       end = 0
00224       start = end
00225       end += 1
00226       (self.success,) = _struct_B.unpack(str[start:end])
00227       self.success = bool(self.success)
00228       return self
00229     except struct.error as e:
00230       raise genpy.DeserializationError(e) #most likely buffer underfill
00231 
00232 _struct_I = genpy.struct_I
00233 _struct_B = struct.Struct("<B")
00234 class BehaviorRequest(object):
00235   _type          = 'hrl_behavior_manager/BehaviorRequest'
00236   _md5sum = '8e9629a6905513d49eb999bf3df640ec'
00237   _request_class  = BehaviorRequestRequest
00238   _response_class = BehaviorRequestResponse


hrl_behavior_manager
Author(s): Kelsey Hawkins
autogenerated on Wed Nov 27 2013 12:14:04