_DoorState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from door_perception_msgs/DoorState.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import std_msgs.msg
00008 
00009 class DoorState(genpy.Message):
00010   _md5sum = "a114a42d272474f60d055d9d646f2970"
00011   _type = "door_perception_msgs/DoorState"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 #Door is considered latched at this angle
00015 float64 DOOR_OPEN_ANGLE=1.5708
00016 #Door is considered traversable at this angle (or above)
00017 float64 DOOR_CLOSED_ANGLE=0.0
00018 #Indicates whether a line could be fit to the sensor data
00019 bool door_found
00020 #Only meaningful if door_found is true
00021 float64 angle
00022 
00023 
00024 ================================================================================
00025 MSG: std_msgs/Header
00026 # Standard metadata for higher-level stamped data types.
00027 # This is generally used to communicate timestamped data 
00028 # in a particular coordinate frame.
00029 # 
00030 # sequence ID: consecutively increasing ID 
00031 uint32 seq
00032 #Two-integer timestamp that is expressed as:
00033 # * stamp.secs: seconds (stamp_secs) since epoch
00034 # * stamp.nsecs: nanoseconds since stamp_secs
00035 # time-handling sugar is provided by the client library
00036 time stamp
00037 #Frame this data is associated with
00038 # 0: no frame
00039 # 1: global frame
00040 string frame_id
00041 
00042 """
00043   # Pseudo-constants
00044   DOOR_OPEN_ANGLE = 1.5708
00045   DOOR_CLOSED_ANGLE = 0.0
00046 
00047   __slots__ = ['header','door_found','angle']
00048   _slot_types = ['std_msgs/Header','bool','float64']
00049 
00050   def __init__(self, *args, **kwds):
00051     """
00052     Constructor. Any message fields that are implicitly/explicitly
00053     set to None will be assigned a default value. The recommend
00054     use is keyword arguments as this is more robust to future message
00055     changes.  You cannot mix in-order arguments and keyword arguments.
00056 
00057     The available fields are:
00058        header,door_found,angle
00059 
00060     :param args: complete set of field values, in .msg order
00061     :param kwds: use keyword arguments corresponding to message field names
00062     to set specific fields.
00063     """
00064     if args or kwds:
00065       super(DoorState, self).__init__(*args, **kwds)
00066       #message fields cannot be None, assign default values for those that are
00067       if self.header is None:
00068         self.header = std_msgs.msg.Header()
00069       if self.door_found is None:
00070         self.door_found = False
00071       if self.angle is None:
00072         self.angle = 0.
00073     else:
00074       self.header = std_msgs.msg.Header()
00075       self.door_found = False
00076       self.angle = 0.
00077 
00078   def _get_types(self):
00079     """
00080     internal API method
00081     """
00082     return self._slot_types
00083 
00084   def serialize(self, buff):
00085     """
00086     serialize message into buffer
00087     :param buff: buffer, ``StringIO``
00088     """
00089     try:
00090       _x = self
00091       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00092       _x = self.header.frame_id
00093       length = len(_x)
00094       if python3 or type(_x) == unicode:
00095         _x = _x.encode('utf-8')
00096         length = len(_x)
00097       buff.write(struct.pack('<I%ss'%length, length, _x))
00098       _x = self
00099       buff.write(_struct_Bd.pack(_x.door_found, _x.angle))
00100     except struct.error as se: self._check_types(se)
00101     except TypeError as te: self._check_types(te)
00102 
00103   def deserialize(self, str):
00104     """
00105     unpack serialized message in str into this message instance
00106     :param str: byte array of serialized message, ``str``
00107     """
00108     try:
00109       if self.header is None:
00110         self.header = std_msgs.msg.Header()
00111       end = 0
00112       _x = self
00113       start = end
00114       end += 12
00115       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00116       start = end
00117       end += 4
00118       (length,) = _struct_I.unpack(str[start:end])
00119       start = end
00120       end += length
00121       if python3:
00122         self.header.frame_id = str[start:end].decode('utf-8')
00123       else:
00124         self.header.frame_id = str[start:end]
00125       _x = self
00126       start = end
00127       end += 9
00128       (_x.door_found, _x.angle,) = _struct_Bd.unpack(str[start:end])
00129       self.door_found = bool(self.door_found)
00130       return self
00131     except struct.error as e:
00132       raise genpy.DeserializationError(e) #most likely buffer underfill
00133 
00134 
00135   def serialize_numpy(self, buff, numpy):
00136     """
00137     serialize message with numpy array types into buffer
00138     :param buff: buffer, ``StringIO``
00139     :param numpy: numpy python module
00140     """
00141     try:
00142       _x = self
00143       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00144       _x = self.header.frame_id
00145       length = len(_x)
00146       if python3 or type(_x) == unicode:
00147         _x = _x.encode('utf-8')
00148         length = len(_x)
00149       buff.write(struct.pack('<I%ss'%length, length, _x))
00150       _x = self
00151       buff.write(_struct_Bd.pack(_x.door_found, _x.angle))
00152     except struct.error as se: self._check_types(se)
00153     except TypeError as te: self._check_types(te)
00154 
00155   def deserialize_numpy(self, str, numpy):
00156     """
00157     unpack serialized message in str into this message instance using numpy for array types
00158     :param str: byte array of serialized message, ``str``
00159     :param numpy: numpy python module
00160     """
00161     try:
00162       if self.header is None:
00163         self.header = std_msgs.msg.Header()
00164       end = 0
00165       _x = self
00166       start = end
00167       end += 12
00168       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00169       start = end
00170       end += 4
00171       (length,) = _struct_I.unpack(str[start:end])
00172       start = end
00173       end += length
00174       if python3:
00175         self.header.frame_id = str[start:end].decode('utf-8')
00176       else:
00177         self.header.frame_id = str[start:end]
00178       _x = self
00179       start = end
00180       end += 9
00181       (_x.door_found, _x.angle,) = _struct_Bd.unpack(str[start:end])
00182       self.door_found = bool(self.door_found)
00183       return self
00184     except struct.error as e:
00185       raise genpy.DeserializationError(e) #most likely buffer underfill
00186 
00187 _struct_I = genpy.struct_I
00188 _struct_Bd = struct.Struct("<Bd")
00189 _struct_3I = struct.Struct("<3I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


door_perception_msgs
Author(s): Felix Endres
autogenerated on Wed Dec 26 2012 15:29:43