_TKSmallImu.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tk_draft_msgs/TKSmallImu.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 import std_msgs.msg
00009 
00010 class TKSmallImu(genpy.Message):
00011   _md5sum = "464450fcea736fec565d7aac952efb90"
00012   _type = "tk_draft_msgs/TKSmallImu"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """#
00015 # Copyright 2011  Antonio Franchi and Martin Riedel    
00016 #
00017 # This file is part of TeleKyb.
00018 #
00019 # TeleKyb is free software: you can redistribute it and/or modify
00020 # it under the terms of the GNU General Public License as published by
00021 # the Free Software Foundation, either version 3 of the License, or
00022 # (at your option) any later version.
00023 #
00024 # TeleKyb is distributed in the hope that it will be useful,
00025 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00026 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00027 # GNU General Public License for more details.
00028 #
00029 # You should have received a copy of the GNU General Public License
00030 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00031 
00032 # Only header and data, no covariance or orientation
00033 Header header
00034 geometry_msgs/Vector3 angular_velocity
00035 geometry_msgs/Vector3 linear_acceleration
00036 
00037 ================================================================================
00038 MSG: std_msgs/Header
00039 # Standard metadata for higher-level stamped data types.
00040 # This is generally used to communicate timestamped data 
00041 # in a particular coordinate frame.
00042 # 
00043 # sequence ID: consecutively increasing ID 
00044 uint32 seq
00045 #Two-integer timestamp that is expressed as:
00046 # * stamp.secs: seconds (stamp_secs) since epoch
00047 # * stamp.nsecs: nanoseconds since stamp_secs
00048 # time-handling sugar is provided by the client library
00049 time stamp
00050 #Frame this data is associated with
00051 # 0: no frame
00052 # 1: global frame
00053 string frame_id
00054 
00055 ================================================================================
00056 MSG: geometry_msgs/Vector3
00057 # This represents a vector in free space. 
00058 
00059 float64 x
00060 float64 y
00061 float64 z
00062 """
00063   __slots__ = ['header','angular_velocity','linear_acceleration']
00064   _slot_types = ['std_msgs/Header','geometry_msgs/Vector3','geometry_msgs/Vector3']
00065 
00066   def __init__(self, *args, **kwds):
00067     """
00068     Constructor. Any message fields that are implicitly/explicitly
00069     set to None will be assigned a default value. The recommend
00070     use is keyword arguments as this is more robust to future message
00071     changes.  You cannot mix in-order arguments and keyword arguments.
00072 
00073     The available fields are:
00074        header,angular_velocity,linear_acceleration
00075 
00076     :param args: complete set of field values, in .msg order
00077     :param kwds: use keyword arguments corresponding to message field names
00078     to set specific fields.
00079     """
00080     if args or kwds:
00081       super(TKSmallImu, self).__init__(*args, **kwds)
00082       #message fields cannot be None, assign default values for those that are
00083       if self.header is None:
00084         self.header = std_msgs.msg.Header()
00085       if self.angular_velocity is None:
00086         self.angular_velocity = geometry_msgs.msg.Vector3()
00087       if self.linear_acceleration is None:
00088         self.linear_acceleration = geometry_msgs.msg.Vector3()
00089     else:
00090       self.header = std_msgs.msg.Header()
00091       self.angular_velocity = geometry_msgs.msg.Vector3()
00092       self.linear_acceleration = geometry_msgs.msg.Vector3()
00093 
00094   def _get_types(self):
00095     """
00096     internal API method
00097     """
00098     return self._slot_types
00099 
00100   def serialize(self, buff):
00101     """
00102     serialize message into buffer
00103     :param buff: buffer, ``StringIO``
00104     """
00105     try:
00106       _x = self
00107       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00108       _x = self.header.frame_id
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self
00115       buff.write(_struct_6d.pack(_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z))
00116     except struct.error as se: self._check_types(se)
00117     except TypeError as 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, ``str``
00123     """
00124     try:
00125       if self.header is None:
00126         self.header = std_msgs.msg.Header()
00127       if self.angular_velocity is None:
00128         self.angular_velocity = geometry_msgs.msg.Vector3()
00129       if self.linear_acceleration is None:
00130         self.linear_acceleration = geometry_msgs.msg.Vector3()
00131       end = 0
00132       _x = self
00133       start = end
00134       end += 12
00135       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00136       start = end
00137       end += 4
00138       (length,) = _struct_I.unpack(str[start:end])
00139       start = end
00140       end += length
00141       if python3:
00142         self.header.frame_id = str[start:end].decode('utf-8')
00143       else:
00144         self.header.frame_id = str[start:end]
00145       _x = self
00146       start = end
00147       end += 48
00148       (_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z,) = _struct_6d.unpack(str[start:end])
00149       return self
00150     except struct.error as e:
00151       raise genpy.DeserializationError(e) #most likely buffer underfill
00152 
00153 
00154   def serialize_numpy(self, buff, numpy):
00155     """
00156     serialize message with numpy array types into buffer
00157     :param buff: buffer, ``StringIO``
00158     :param numpy: numpy python module
00159     """
00160     try:
00161       _x = self
00162       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00163       _x = self.header.frame_id
00164       length = len(_x)
00165       if python3 or type(_x) == unicode:
00166         _x = _x.encode('utf-8')
00167         length = len(_x)
00168       buff.write(struct.pack('<I%ss'%length, length, _x))
00169       _x = self
00170       buff.write(_struct_6d.pack(_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z))
00171     except struct.error as se: self._check_types(se)
00172     except TypeError as te: self._check_types(te)
00173 
00174   def deserialize_numpy(self, str, numpy):
00175     """
00176     unpack serialized message in str into this message instance using numpy for array types
00177     :param str: byte array of serialized message, ``str``
00178     :param numpy: numpy python module
00179     """
00180     try:
00181       if self.header is None:
00182         self.header = std_msgs.msg.Header()
00183       if self.angular_velocity is None:
00184         self.angular_velocity = geometry_msgs.msg.Vector3()
00185       if self.linear_acceleration is None:
00186         self.linear_acceleration = geometry_msgs.msg.Vector3()
00187       end = 0
00188       _x = self
00189       start = end
00190       end += 12
00191       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00192       start = end
00193       end += 4
00194       (length,) = _struct_I.unpack(str[start:end])
00195       start = end
00196       end += length
00197       if python3:
00198         self.header.frame_id = str[start:end].decode('utf-8')
00199       else:
00200         self.header.frame_id = str[start:end]
00201       _x = self
00202       start = end
00203       end += 48
00204       (_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z,) = _struct_6d.unpack(str[start:end])
00205       return self
00206     except struct.error as e:
00207       raise genpy.DeserializationError(e) #most likely buffer underfill
00208 
00209 _struct_I = genpy.struct_I
00210 _struct_3I = struct.Struct("<3I")
00211 _struct_6d = struct.Struct("<6d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


tk_draft_msgs
Author(s): Martin Riedel
autogenerated on Mon Nov 11 2013 11:12:57