_OrientedBoundingBox.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arm_navigation_msgs/OrientedBoundingBox.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 OrientedBoundingBox(genpy.Message):
00010   _md5sum = "a9b13162620bd04a7cb84cf207e7a8ac"
00011   _type = "arm_navigation_msgs/OrientedBoundingBox"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """#the center of the box
00014 geometry_msgs/Point32 center
00015 
00016 #the extents of the box, assuming the center is at the point
00017 geometry_msgs/Point32 extents
00018 
00019 #the axis of the box
00020 geometry_msgs/Point32 axis
00021 
00022 #the angle of rotation around the axis
00023 float32 angle
00024 
00025 ================================================================================
00026 MSG: geometry_msgs/Point32
00027 # This contains the position of a point in free space(with 32 bits of precision).
00028 # It is recommeded to use Point wherever possible instead of Point32.  
00029 # 
00030 # This recommendation is to promote interoperability.  
00031 #
00032 # This message is designed to take up less space when sending
00033 # lots of points at once, as in the case of a PointCloud.  
00034 
00035 float32 x
00036 float32 y
00037 float32 z
00038 """
00039   __slots__ = ['center','extents','axis','angle']
00040   _slot_types = ['geometry_msgs/Point32','geometry_msgs/Point32','geometry_msgs/Point32','float32']
00041 
00042   def __init__(self, *args, **kwds):
00043     """
00044     Constructor. Any message fields that are implicitly/explicitly
00045     set to None will be assigned a default value. The recommend
00046     use is keyword arguments as this is more robust to future message
00047     changes.  You cannot mix in-order arguments and keyword arguments.
00048 
00049     The available fields are:
00050        center,extents,axis,angle
00051 
00052     :param args: complete set of field values, in .msg order
00053     :param kwds: use keyword arguments corresponding to message field names
00054     to set specific fields.
00055     """
00056     if args or kwds:
00057       super(OrientedBoundingBox, self).__init__(*args, **kwds)
00058       #message fields cannot be None, assign default values for those that are
00059       if self.center is None:
00060         self.center = geometry_msgs.msg.Point32()
00061       if self.extents is None:
00062         self.extents = geometry_msgs.msg.Point32()
00063       if self.axis is None:
00064         self.axis = geometry_msgs.msg.Point32()
00065       if self.angle is None:
00066         self.angle = 0.
00067     else:
00068       self.center = geometry_msgs.msg.Point32()
00069       self.extents = geometry_msgs.msg.Point32()
00070       self.axis = geometry_msgs.msg.Point32()
00071       self.angle = 0.
00072 
00073   def _get_types(self):
00074     """
00075     internal API method
00076     """
00077     return self._slot_types
00078 
00079   def serialize(self, buff):
00080     """
00081     serialize message into buffer
00082     :param buff: buffer, ``StringIO``
00083     """
00084     try:
00085       _x = self
00086       buff.write(_struct_10f.pack(_x.center.x, _x.center.y, _x.center.z, _x.extents.x, _x.extents.y, _x.extents.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.angle))
00087     except struct.error as se: self._check_types(se)
00088     except TypeError as te: self._check_types(te)
00089 
00090   def deserialize(self, str):
00091     """
00092     unpack serialized message in str into this message instance
00093     :param str: byte array of serialized message, ``str``
00094     """
00095     try:
00096       if self.center is None:
00097         self.center = geometry_msgs.msg.Point32()
00098       if self.extents is None:
00099         self.extents = geometry_msgs.msg.Point32()
00100       if self.axis is None:
00101         self.axis = geometry_msgs.msg.Point32()
00102       end = 0
00103       _x = self
00104       start = end
00105       end += 40
00106       (_x.center.x, _x.center.y, _x.center.z, _x.extents.x, _x.extents.y, _x.extents.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.angle,) = _struct_10f.unpack(str[start:end])
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 
00112   def serialize_numpy(self, buff, numpy):
00113     """
00114     serialize message with numpy array types into buffer
00115     :param buff: buffer, ``StringIO``
00116     :param numpy: numpy python module
00117     """
00118     try:
00119       _x = self
00120       buff.write(_struct_10f.pack(_x.center.x, _x.center.y, _x.center.z, _x.extents.x, _x.extents.y, _x.extents.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.angle))
00121     except struct.error as se: self._check_types(se)
00122     except TypeError as te: self._check_types(te)
00123 
00124   def deserialize_numpy(self, str, numpy):
00125     """
00126     unpack serialized message in str into this message instance using numpy for array types
00127     :param str: byte array of serialized message, ``str``
00128     :param numpy: numpy python module
00129     """
00130     try:
00131       if self.center is None:
00132         self.center = geometry_msgs.msg.Point32()
00133       if self.extents is None:
00134         self.extents = geometry_msgs.msg.Point32()
00135       if self.axis is None:
00136         self.axis = geometry_msgs.msg.Point32()
00137       end = 0
00138       _x = self
00139       start = end
00140       end += 40
00141       (_x.center.x, _x.center.y, _x.center.z, _x.extents.x, _x.extents.y, _x.extents.z, _x.axis.x, _x.axis.y, _x.axis.z, _x.angle,) = _struct_10f.unpack(str[start:end])
00142       return self
00143     except struct.error as e:
00144       raise genpy.DeserializationError(e) #most likely buffer underfill
00145 
00146 _struct_I = genpy.struct_I
00147 _struct_10f = struct.Struct("<10f")


arm_navigation_msgs
Author(s): Gil Jones
autogenerated on Thu Dec 12 2013 11:08:10