_LaserObjectIdWithPose.py
Go to the documentation of this file.
00001 """autogenerated by genpy from mapping_ias_msgs/LaserObjectIdWithPose.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 geometry_msgs.msg
00008 
00009 class LaserObjectIdWithPose(genpy.Message):
00010   _md5sum = "ef23f3dc03dc1c9d1c4df8cd45f7543c"
00011   _type = "mapping_ias_msgs/LaserObjectIdWithPose"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """uint64 obj_id      # id
00014 float64[] pose   # position + pose of object (4x4 Matrix)
00015 geometry_msgs/Point32[] AABB    # AABB in object frame
00016 
00017 ================================================================================
00018 MSG: geometry_msgs/Point32
00019 # This contains the position of a point in free space(with 32 bits of precision).
00020 # It is recommeded to use Point wherever possible instead of Point32.  
00021 # 
00022 # This recommendation is to promote interoperability.  
00023 #
00024 # This message is designed to take up less space when sending
00025 # lots of points at once, as in the case of a PointCloud.  
00026 
00027 float32 x
00028 float32 y
00029 float32 z
00030 """
00031   __slots__ = ['obj_id','pose','AABB']
00032   _slot_types = ['uint64','float64[]','geometry_msgs/Point32[]']
00033 
00034   def __init__(self, *args, **kwds):
00035     """
00036     Constructor. Any message fields that are implicitly/explicitly
00037     set to None will be assigned a default value. The recommend
00038     use is keyword arguments as this is more robust to future message
00039     changes.  You cannot mix in-order arguments and keyword arguments.
00040 
00041     The available fields are:
00042        obj_id,pose,AABB
00043 
00044     :param args: complete set of field values, in .msg order
00045     :param kwds: use keyword arguments corresponding to message field names
00046     to set specific fields.
00047     """
00048     if args or kwds:
00049       super(LaserObjectIdWithPose, self).__init__(*args, **kwds)
00050       #message fields cannot be None, assign default values for those that are
00051       if self.obj_id is None:
00052         self.obj_id = 0
00053       if self.pose is None:
00054         self.pose = []
00055       if self.AABB is None:
00056         self.AABB = []
00057     else:
00058       self.obj_id = 0
00059       self.pose = []
00060       self.AABB = []
00061 
00062   def _get_types(self):
00063     """
00064     internal API method
00065     """
00066     return self._slot_types
00067 
00068   def serialize(self, buff):
00069     """
00070     serialize message into buffer
00071     :param buff: buffer, ``StringIO``
00072     """
00073     try:
00074       buff.write(_struct_Q.pack(self.obj_id))
00075       length = len(self.pose)
00076       buff.write(_struct_I.pack(length))
00077       pattern = '<%sd'%length
00078       buff.write(struct.pack(pattern, *self.pose))
00079       length = len(self.AABB)
00080       buff.write(_struct_I.pack(length))
00081       for val1 in self.AABB:
00082         _x = val1
00083         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00084     except struct.error as se: self._check_types(se)
00085     except TypeError as te: self._check_types(te)
00086 
00087   def deserialize(self, str):
00088     """
00089     unpack serialized message in str into this message instance
00090     :param str: byte array of serialized message, ``str``
00091     """
00092     try:
00093       if self.AABB is None:
00094         self.AABB = None
00095       end = 0
00096       start = end
00097       end += 8
00098       (self.obj_id,) = _struct_Q.unpack(str[start:end])
00099       start = end
00100       end += 4
00101       (length,) = _struct_I.unpack(str[start:end])
00102       pattern = '<%sd'%length
00103       start = end
00104       end += struct.calcsize(pattern)
00105       self.pose = struct.unpack(pattern, str[start:end])
00106       start = end
00107       end += 4
00108       (length,) = _struct_I.unpack(str[start:end])
00109       self.AABB = []
00110       for i in range(0, length):
00111         val1 = geometry_msgs.msg.Point32()
00112         _x = val1
00113         start = end
00114         end += 12
00115         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00116         self.AABB.append(val1)
00117       return self
00118     except struct.error as e:
00119       raise genpy.DeserializationError(e) #most likely buffer underfill
00120 
00121 
00122   def serialize_numpy(self, buff, numpy):
00123     """
00124     serialize message with numpy array types into buffer
00125     :param buff: buffer, ``StringIO``
00126     :param numpy: numpy python module
00127     """
00128     try:
00129       buff.write(_struct_Q.pack(self.obj_id))
00130       length = len(self.pose)
00131       buff.write(_struct_I.pack(length))
00132       pattern = '<%sd'%length
00133       buff.write(self.pose.tostring())
00134       length = len(self.AABB)
00135       buff.write(_struct_I.pack(length))
00136       for val1 in self.AABB:
00137         _x = val1
00138         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00139     except struct.error as se: self._check_types(se)
00140     except TypeError as te: self._check_types(te)
00141 
00142   def deserialize_numpy(self, str, numpy):
00143     """
00144     unpack serialized message in str into this message instance using numpy for array types
00145     :param str: byte array of serialized message, ``str``
00146     :param numpy: numpy python module
00147     """
00148     try:
00149       if self.AABB is None:
00150         self.AABB = None
00151       end = 0
00152       start = end
00153       end += 8
00154       (self.obj_id,) = _struct_Q.unpack(str[start:end])
00155       start = end
00156       end += 4
00157       (length,) = _struct_I.unpack(str[start:end])
00158       pattern = '<%sd'%length
00159       start = end
00160       end += struct.calcsize(pattern)
00161       self.pose = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00162       start = end
00163       end += 4
00164       (length,) = _struct_I.unpack(str[start:end])
00165       self.AABB = []
00166       for i in range(0, length):
00167         val1 = geometry_msgs.msg.Point32()
00168         _x = val1
00169         start = end
00170         end += 12
00171         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00172         self.AABB.append(val1)
00173       return self
00174     except struct.error as e:
00175       raise genpy.DeserializationError(e) #most likely buffer underfill
00176 
00177 _struct_I = genpy.struct_I
00178 _struct_Q = struct.Struct("<Q")
00179 _struct_3f = struct.Struct("<3f")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


mapping_ias_msgs
Author(s): Dejan Pangercic, Nico Blodow
autogenerated on Thu May 23 2013 15:28:47