00001 """autogenerated by genmsg_py from OctomapBinaryWithPose.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import std_msgs.msg
00007
00008 class OctomapBinaryWithPose(roslib.message.Message):
00009 _md5sum = "b8fb58fc8c87150ac05695a4df6e2250"
00010 _type = "octomap_ros/OctomapBinaryWithPose"
00011 _has_header = True
00012 _full_text = """# A 3D map in binary format, as Octree
00013 Header header
00014 int32 id
00015 geometry_msgs/Pose origin
00016 int8[] data
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data
00021 # in a particular coordinate frame.
00022 #
00023 # sequence ID: consecutively increasing ID
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034
00035 ================================================================================
00036 MSG: geometry_msgs/Pose
00037 # A representation of pose in free space, composed of postion and orientation.
00038 Point position
00039 Quaternion orientation
00040
00041 ================================================================================
00042 MSG: geometry_msgs/Point
00043 # This contains the position of a point in free space
00044 float64 x
00045 float64 y
00046 float64 z
00047
00048 ================================================================================
00049 MSG: geometry_msgs/Quaternion
00050 # This represents an orientation in free space in quaternion form.
00051
00052 float64 x
00053 float64 y
00054 float64 z
00055 float64 w
00056
00057 """
00058 __slots__ = ['header','id','origin','data']
00059 _slot_types = ['Header','int32','geometry_msgs/Pose','int8[]']
00060
00061 def __init__(self, *args, **kwds):
00062 """
00063 Constructor. Any message fields that are implicitly/explicitly
00064 set to None will be assigned a default value. The recommend
00065 use is keyword arguments as this is more robust to future message
00066 changes. You cannot mix in-order arguments and keyword arguments.
00067
00068 The available fields are:
00069 header,id,origin,data
00070
00071 @param args: complete set of field values, in .msg order
00072 @param kwds: use keyword arguments corresponding to message field names
00073 to set specific fields.
00074 """
00075 if args or kwds:
00076 super(OctomapBinaryWithPose, self).__init__(*args, **kwds)
00077
00078 if self.header is None:
00079 self.header = std_msgs.msg._Header.Header()
00080 if self.id is None:
00081 self.id = 0
00082 if self.origin is None:
00083 self.origin = geometry_msgs.msg.Pose()
00084 if self.data is None:
00085 self.data = []
00086 else:
00087 self.header = std_msgs.msg._Header.Header()
00088 self.id = 0
00089 self.origin = geometry_msgs.msg.Pose()
00090 self.data = []
00091
00092 def _get_types(self):
00093 """
00094 internal API method
00095 """
00096 return self._slot_types
00097
00098 def serialize(self, buff):
00099 """
00100 serialize message into buffer
00101 @param buff: buffer
00102 @type buff: StringIO
00103 """
00104 try:
00105 _x = self
00106 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00107 _x = self.header.frame_id
00108 length = len(_x)
00109 buff.write(struct.pack('<I%ss'%length, length, _x))
00110 _x = self
00111 buff.write(_struct_i7d.pack(_x.id, _x.origin.position.x, _x.origin.position.y, _x.origin.position.z, _x.origin.orientation.x, _x.origin.orientation.y, _x.origin.orientation.z, _x.origin.orientation.w))
00112 length = len(self.data)
00113 buff.write(_struct_I.pack(length))
00114 pattern = '<%sb'%length
00115 buff.write(struct.pack(pattern, *self.data))
00116 except struct.error, se: self._check_types(se)
00117 except TypeError, te: self._check_types(te)
00118
00119 def deserialize(self, str):
00120 """
00121 unpack serialized message in str into this message instance
00122 @param str: byte array of serialized message
00123 @type str: str
00124 """
00125 try:
00126 if self.header is None:
00127 self.header = std_msgs.msg._Header.Header()
00128 if self.origin is None:
00129 self.origin = geometry_msgs.msg.Pose()
00130 end = 0
00131 _x = self
00132 start = end
00133 end += 12
00134 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00135 start = end
00136 end += 4
00137 (length,) = _struct_I.unpack(str[start:end])
00138 start = end
00139 end += length
00140 self.header.frame_id = str[start:end]
00141 _x = self
00142 start = end
00143 end += 60
00144 (_x.id, _x.origin.position.x, _x.origin.position.y, _x.origin.position.z, _x.origin.orientation.x, _x.origin.orientation.y, _x.origin.orientation.z, _x.origin.orientation.w,) = _struct_i7d.unpack(str[start:end])
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 pattern = '<%sb'%length
00149 start = end
00150 end += struct.calcsize(pattern)
00151 self.data = struct.unpack(pattern, str[start:end])
00152 return self
00153 except struct.error, e:
00154 raise roslib.message.DeserializationError(e)
00155
00156
00157 def serialize_numpy(self, buff, numpy):
00158 """
00159 serialize message with numpy array types into buffer
00160 @param buff: buffer
00161 @type buff: StringIO
00162 @param numpy: numpy python module
00163 @type numpy module
00164 """
00165 try:
00166 _x = self
00167 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00168 _x = self.header.frame_id
00169 length = len(_x)
00170 buff.write(struct.pack('<I%ss'%length, length, _x))
00171 _x = self
00172 buff.write(_struct_i7d.pack(_x.id, _x.origin.position.x, _x.origin.position.y, _x.origin.position.z, _x.origin.orientation.x, _x.origin.orientation.y, _x.origin.orientation.z, _x.origin.orientation.w))
00173 length = len(self.data)
00174 buff.write(_struct_I.pack(length))
00175 pattern = '<%sb'%length
00176 buff.write(self.data.tostring())
00177 except struct.error, se: self._check_types(se)
00178 except TypeError, te: self._check_types(te)
00179
00180 def deserialize_numpy(self, str, numpy):
00181 """
00182 unpack serialized message in str into this message instance using numpy for array types
00183 @param str: byte array of serialized message
00184 @type str: str
00185 @param numpy: numpy python module
00186 @type numpy: module
00187 """
00188 try:
00189 if self.header is None:
00190 self.header = std_msgs.msg._Header.Header()
00191 if self.origin is None:
00192 self.origin = geometry_msgs.msg.Pose()
00193 end = 0
00194 _x = self
00195 start = end
00196 end += 12
00197 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00198 start = end
00199 end += 4
00200 (length,) = _struct_I.unpack(str[start:end])
00201 start = end
00202 end += length
00203 self.header.frame_id = str[start:end]
00204 _x = self
00205 start = end
00206 end += 60
00207 (_x.id, _x.origin.position.x, _x.origin.position.y, _x.origin.position.z, _x.origin.orientation.x, _x.origin.orientation.y, _x.origin.orientation.z, _x.origin.orientation.w,) = _struct_i7d.unpack(str[start:end])
00208 start = end
00209 end += 4
00210 (length,) = _struct_I.unpack(str[start:end])
00211 pattern = '<%sb'%length
00212 start = end
00213 end += struct.calcsize(pattern)
00214 self.data = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length)
00215 return self
00216 except struct.error, e:
00217 raise roslib.message.DeserializationError(e)
00218
00219 _struct_I = roslib.message.struct_I
00220 _struct_3I = struct.Struct("<3I")
00221 _struct_i7d = struct.Struct("<i7d")