_ObjectState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hector_worldmodel_msgs/ObjectState.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 ObjectState(genpy.Message):
00009   _md5sum = "5bb1b6744a4e40af3e4b8b56b4e06597"
00010   _type = "hector_worldmodel_msgs/ObjectState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# The state of an object estimate used to track
00013 # states smaller than 0 disable all updates
00014 
00015 # Predefined states. Use states smaller than 0 or bigger than 63 for user defined states.
00016 int8 UNKNOWN = 0
00017 int8 PENDING = 1
00018 int8 ACTIVE  = 2
00019 int8 INACTIVE = 3
00020 int8 CONFIRMED = -1
00021 int8 DISCARDED = -2
00022 int8 APPROACHING = -3
00023 
00024 int8 state
00025 
00026 """
00027   # Pseudo-constants
00028   UNKNOWN = 0
00029   PENDING = 1
00030   ACTIVE = 2
00031   INACTIVE = 3
00032   CONFIRMED = -1
00033   DISCARDED = -2
00034   APPROACHING = -3
00035 
00036   __slots__ = ['state']
00037   _slot_types = ['int8']
00038 
00039   def __init__(self, *args, **kwds):
00040     """
00041     Constructor. Any message fields that are implicitly/explicitly
00042     set to None will be assigned a default value. The recommend
00043     use is keyword arguments as this is more robust to future message
00044     changes.  You cannot mix in-order arguments and keyword arguments.
00045 
00046     The available fields are:
00047        state
00048 
00049     :param args: complete set of field values, in .msg order
00050     :param kwds: use keyword arguments corresponding to message field names
00051     to set specific fields.
00052     """
00053     if args or kwds:
00054       super(ObjectState, self).__init__(*args, **kwds)
00055       #message fields cannot be None, assign default values for those that are
00056       if self.state is None:
00057         self.state = 0
00058     else:
00059       self.state = 0
00060 
00061   def _get_types(self):
00062     """
00063     internal API method
00064     """
00065     return self._slot_types
00066 
00067   def serialize(self, buff):
00068     """
00069     serialize message into buffer
00070     :param buff: buffer, ``StringIO``
00071     """
00072     try:
00073       buff.write(_struct_b.pack(self.state))
00074     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00075     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00076 
00077   def deserialize(self, str):
00078     """
00079     unpack serialized message in str into this message instance
00080     :param str: byte array of serialized message, ``str``
00081     """
00082     try:
00083       end = 0
00084       start = end
00085       end += 1
00086       (self.state,) = _struct_b.unpack(str[start:end])
00087       return self
00088     except struct.error as e:
00089       raise genpy.DeserializationError(e) #most likely buffer underfill
00090 
00091 
00092   def serialize_numpy(self, buff, numpy):
00093     """
00094     serialize message with numpy array types into buffer
00095     :param buff: buffer, ``StringIO``
00096     :param numpy: numpy python module
00097     """
00098     try:
00099       buff.write(_struct_b.pack(self.state))
00100     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00101     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00102 
00103   def deserialize_numpy(self, str, numpy):
00104     """
00105     unpack serialized message in str into this message instance using numpy for array types
00106     :param str: byte array of serialized message, ``str``
00107     :param numpy: numpy python module
00108     """
00109     try:
00110       end = 0
00111       start = end
00112       end += 1
00113       (self.state,) = _struct_b.unpack(str[start:end])
00114       return self
00115     except struct.error as e:
00116       raise genpy.DeserializationError(e) #most likely buffer underfill
00117 
00118 _struct_I = genpy.struct_I
00119 _struct_b = struct.Struct("<b")


hector_worldmodel_msgs
Author(s): Johannes Meyer
autogenerated on Mon Oct 6 2014 00:36:27