_CollisionMap.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arm_navigation_msgs/CollisionMap.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 arm_navigation_msgs.msg
00008 import geometry_msgs.msg
00009 import std_msgs.msg
00010 
00011 class CollisionMap(genpy.Message):
00012   _md5sum = "18ca54db41ccebbe82f61f9801dede89"
00013   _type = "arm_navigation_msgs/CollisionMap"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """#header for interpreting box positions
00016 Header header
00017 
00018 #boxes for use in collision testing
00019 OrientedBoundingBox[] boxes
00020 
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data 
00025 # in a particular coordinate frame.
00026 # 
00027 # sequence ID: consecutively increasing ID 
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038 
00039 ================================================================================
00040 MSG: arm_navigation_msgs/OrientedBoundingBox
00041 #the center of the box
00042 geometry_msgs/Point32 center
00043 
00044 #the extents of the box, assuming the center is at the point
00045 geometry_msgs/Point32 extents
00046 
00047 #the axis of the box
00048 geometry_msgs/Point32 axis
00049 
00050 #the angle of rotation around the axis
00051 float32 angle
00052 
00053 ================================================================================
00054 MSG: geometry_msgs/Point32
00055 # This contains the position of a point in free space(with 32 bits of precision).
00056 # It is recommeded to use Point wherever possible instead of Point32.  
00057 # 
00058 # This recommendation is to promote interoperability.  
00059 #
00060 # This message is designed to take up less space when sending
00061 # lots of points at once, as in the case of a PointCloud.  
00062 
00063 float32 x
00064 float32 y
00065 float32 z
00066 """
00067   __slots__ = ['header','boxes']
00068   _slot_types = ['std_msgs/Header','arm_navigation_msgs/OrientedBoundingBox[]']
00069 
00070   def __init__(self, *args, **kwds):
00071     """
00072     Constructor. Any message fields that are implicitly/explicitly
00073     set to None will be assigned a default value. The recommend
00074     use is keyword arguments as this is more robust to future message
00075     changes.  You cannot mix in-order arguments and keyword arguments.
00076 
00077     The available fields are:
00078        header,boxes
00079 
00080     :param args: complete set of field values, in .msg order
00081     :param kwds: use keyword arguments corresponding to message field names
00082     to set specific fields.
00083     """
00084     if args or kwds:
00085       super(CollisionMap, self).__init__(*args, **kwds)
00086       #message fields cannot be None, assign default values for those that are
00087       if self.header is None:
00088         self.header = std_msgs.msg.Header()
00089       if self.boxes is None:
00090         self.boxes = []
00091     else:
00092       self.header = std_msgs.msg.Header()
00093       self.boxes = []
00094 
00095   def _get_types(self):
00096     """
00097     internal API method
00098     """
00099     return self._slot_types
00100 
00101   def serialize(self, buff):
00102     """
00103     serialize message into buffer
00104     :param buff: buffer, ``StringIO``
00105     """
00106     try:
00107       _x = self
00108       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00109       _x = self.header.frame_id
00110       length = len(_x)
00111       if python3 or type(_x) == unicode:
00112         _x = _x.encode('utf-8')
00113         length = len(_x)
00114       buff.write(struct.pack('<I%ss'%length, length, _x))
00115       length = len(self.boxes)
00116       buff.write(_struct_I.pack(length))
00117       for val1 in self.boxes:
00118         _v1 = val1.center
00119         _x = _v1
00120         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00121         _v2 = val1.extents
00122         _x = _v2
00123         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00124         _v3 = val1.axis
00125         _x = _v3
00126         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00127         buff.write(_struct_f.pack(val1.angle))
00128     except struct.error as se: self._check_types(se)
00129     except TypeError as te: self._check_types(te)
00130 
00131   def deserialize(self, str):
00132     """
00133     unpack serialized message in str into this message instance
00134     :param str: byte array of serialized message, ``str``
00135     """
00136     try:
00137       if self.header is None:
00138         self.header = std_msgs.msg.Header()
00139       if self.boxes is None:
00140         self.boxes = None
00141       end = 0
00142       _x = self
00143       start = end
00144       end += 12
00145       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       start = end
00150       end += length
00151       if python3:
00152         self.header.frame_id = str[start:end].decode('utf-8')
00153       else:
00154         self.header.frame_id = str[start:end]
00155       start = end
00156       end += 4
00157       (length,) = _struct_I.unpack(str[start:end])
00158       self.boxes = []
00159       for i in range(0, length):
00160         val1 = arm_navigation_msgs.msg.OrientedBoundingBox()
00161         _v4 = val1.center
00162         _x = _v4
00163         start = end
00164         end += 12
00165         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00166         _v5 = val1.extents
00167         _x = _v5
00168         start = end
00169         end += 12
00170         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00171         _v6 = val1.axis
00172         _x = _v6
00173         start = end
00174         end += 12
00175         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00176         start = end
00177         end += 4
00178         (val1.angle,) = _struct_f.unpack(str[start:end])
00179         self.boxes.append(val1)
00180       return self
00181     except struct.error as e:
00182       raise genpy.DeserializationError(e) #most likely buffer underfill
00183 
00184 
00185   def serialize_numpy(self, buff, numpy):
00186     """
00187     serialize message with numpy array types into buffer
00188     :param buff: buffer, ``StringIO``
00189     :param numpy: numpy python module
00190     """
00191     try:
00192       _x = self
00193       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00194       _x = self.header.frame_id
00195       length = len(_x)
00196       if python3 or type(_x) == unicode:
00197         _x = _x.encode('utf-8')
00198         length = len(_x)
00199       buff.write(struct.pack('<I%ss'%length, length, _x))
00200       length = len(self.boxes)
00201       buff.write(_struct_I.pack(length))
00202       for val1 in self.boxes:
00203         _v7 = val1.center
00204         _x = _v7
00205         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00206         _v8 = val1.extents
00207         _x = _v8
00208         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00209         _v9 = val1.axis
00210         _x = _v9
00211         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00212         buff.write(_struct_f.pack(val1.angle))
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       if self.header is None:
00224         self.header = std_msgs.msg.Header()
00225       if self.boxes is None:
00226         self.boxes = None
00227       end = 0
00228       _x = self
00229       start = end
00230       end += 12
00231       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00232       start = end
00233       end += 4
00234       (length,) = _struct_I.unpack(str[start:end])
00235       start = end
00236       end += length
00237       if python3:
00238         self.header.frame_id = str[start:end].decode('utf-8')
00239       else:
00240         self.header.frame_id = str[start:end]
00241       start = end
00242       end += 4
00243       (length,) = _struct_I.unpack(str[start:end])
00244       self.boxes = []
00245       for i in range(0, length):
00246         val1 = arm_navigation_msgs.msg.OrientedBoundingBox()
00247         _v10 = val1.center
00248         _x = _v10
00249         start = end
00250         end += 12
00251         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00252         _v11 = val1.extents
00253         _x = _v11
00254         start = end
00255         end += 12
00256         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00257         _v12 = val1.axis
00258         _x = _v12
00259         start = end
00260         end += 12
00261         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00262         start = end
00263         end += 4
00264         (val1.angle,) = _struct_f.unpack(str[start:end])
00265         self.boxes.append(val1)
00266       return self
00267     except struct.error as e:
00268       raise genpy.DeserializationError(e) #most likely buffer underfill
00269 
00270 _struct_I = genpy.struct_I
00271 _struct_3I = struct.Struct("<3I")
00272 _struct_3f = struct.Struct("<3f")
00273 _struct_f = struct.Struct("<f")


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