00001 """autogenerated by genmsg_py from Height.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class Height(roslib.message.Message):
00008 _md5sum = "a78e1294ab4281402b080d0478dd360c"
00009 _type = "mav_msgs/Height"
00010 _has_header = True
00011 _full_text = """# Software License Agreement (BSD License)
00012 #
00013 # Copyright (c) 2010
00014 # Ivan Dryanovski <ivan.dryanovski@gmail.com>
00015 # All rights reserved.
00016 #
00017 # Redistribution and use in source and binary forms, with or without
00018 # modification, are permitted provided that the following conditions
00019 # are met:
00020 #
00021 # * Redistributions of source code must retain the above copyright
00022 # notice, this list of conditions and the following disclaimer.
00023 # * Redistributions in binary form must reproduce the above
00024 # copyright notice, this list of conditions and the following
00025 # disclaimer in the documentation and/or other materials provided
00026 # with the distribution.
00027 # * Neither the name of CCNY Robotics Lab nor the names of its
00028 # contributors may be used to endorse or promote products derived
00029 # from this software without specific prior written permission.
00030 #
00031 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00032 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00033 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00034 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00035 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00036 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00037 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00038 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00039 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00040 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00041 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00042 # POSSIBILITY OF SUCH DAMAGE.
00043
00044 Header header
00045
00046 float64 height
00047 float64 height_variance
00048
00049 float64 climb
00050 float64 climb_variance
00051
00052 ================================================================================
00053 MSG: std_msgs/Header
00054 # Standard metadata for higher-level stamped data types.
00055 # This is generally used to communicate timestamped data
00056 # in a particular coordinate frame.
00057 #
00058 # sequence ID: consecutively increasing ID
00059 uint32 seq
00060 #Two-integer timestamp that is expressed as:
00061 # * stamp.secs: seconds (stamp_secs) since epoch
00062 # * stamp.nsecs: nanoseconds since stamp_secs
00063 # time-handling sugar is provided by the client library
00064 time stamp
00065 #Frame this data is associated with
00066 # 0: no frame
00067 # 1: global frame
00068 string frame_id
00069
00070 """
00071 __slots__ = ['header','height','height_variance','climb','climb_variance']
00072 _slot_types = ['Header','float64','float64','float64','float64']
00073
00074 def __init__(self, *args, **kwds):
00075 """
00076 Constructor. Any message fields that are implicitly/explicitly
00077 set to None will be assigned a default value. The recommend
00078 use is keyword arguments as this is more robust to future message
00079 changes. You cannot mix in-order arguments and keyword arguments.
00080
00081 The available fields are:
00082 header,height,height_variance,climb,climb_variance
00083
00084 @param args: complete set of field values, in .msg order
00085 @param kwds: use keyword arguments corresponding to message field names
00086 to set specific fields.
00087 """
00088 if args or kwds:
00089 super(Height, self).__init__(*args, **kwds)
00090
00091 if self.header is None:
00092 self.header = std_msgs.msg._Header.Header()
00093 if self.height is None:
00094 self.height = 0.
00095 if self.height_variance is None:
00096 self.height_variance = 0.
00097 if self.climb is None:
00098 self.climb = 0.
00099 if self.climb_variance is None:
00100 self.climb_variance = 0.
00101 else:
00102 self.header = std_msgs.msg._Header.Header()
00103 self.height = 0.
00104 self.height_variance = 0.
00105 self.climb = 0.
00106 self.climb_variance = 0.
00107
00108 def _get_types(self):
00109 """
00110 internal API method
00111 """
00112 return self._slot_types
00113
00114 def serialize(self, buff):
00115 """
00116 serialize message into buffer
00117 @param buff: buffer
00118 @type buff: StringIO
00119 """
00120 try:
00121 _x = self
00122 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00123 _x = self.header.frame_id
00124 length = len(_x)
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 _x = self
00127 buff.write(_struct_4d.pack(_x.height, _x.height_variance, _x.climb, _x.climb_variance))
00128 except struct.error, se: self._check_types(se)
00129 except TypeError, 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
00135 @type str: str
00136 """
00137 try:
00138 if self.header is None:
00139 self.header = std_msgs.msg._Header.Header()
00140 end = 0
00141 _x = self
00142 start = end
00143 end += 12
00144 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 self.header.frame_id = str[start:end]
00151 _x = self
00152 start = end
00153 end += 32
00154 (_x.height, _x.height_variance, _x.climb, _x.climb_variance,) = _struct_4d.unpack(str[start:end])
00155 return self
00156 except struct.error, e:
00157 raise roslib.message.DeserializationError(e)
00158
00159
00160 def serialize_numpy(self, buff, numpy):
00161 """
00162 serialize message with numpy array types into buffer
00163 @param buff: buffer
00164 @type buff: StringIO
00165 @param numpy: numpy python module
00166 @type numpy module
00167 """
00168 try:
00169 _x = self
00170 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00171 _x = self.header.frame_id
00172 length = len(_x)
00173 buff.write(struct.pack('<I%ss'%length, length, _x))
00174 _x = self
00175 buff.write(_struct_4d.pack(_x.height, _x.height_variance, _x.climb, _x.climb_variance))
00176 except struct.error, se: self._check_types(se)
00177 except TypeError, te: self._check_types(te)
00178
00179 def deserialize_numpy(self, str, numpy):
00180 """
00181 unpack serialized message in str into this message instance using numpy for array types
00182 @param str: byte array of serialized message
00183 @type str: str
00184 @param numpy: numpy python module
00185 @type numpy: module
00186 """
00187 try:
00188 if self.header is None:
00189 self.header = std_msgs.msg._Header.Header()
00190 end = 0
00191 _x = self
00192 start = end
00193 end += 12
00194 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00195 start = end
00196 end += 4
00197 (length,) = _struct_I.unpack(str[start:end])
00198 start = end
00199 end += length
00200 self.header.frame_id = str[start:end]
00201 _x = self
00202 start = end
00203 end += 32
00204 (_x.height, _x.height_variance, _x.climb, _x.climb_variance,) = _struct_4d.unpack(str[start:end])
00205 return self
00206 except struct.error, e:
00207 raise roslib.message.DeserializationError(e)
00208
00209 _struct_I = roslib.message.struct_I
00210 _struct_3I = struct.Struct("<3I")
00211 _struct_4d = struct.Struct("<4d")