_TorsoOdometry.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nao_msgs/TorsoOdometry.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 std_msgs.msg
00008 
00009 class TorsoOdometry(genpy.Message):
00010   _md5sum = "1f66dc501c9b69278147e3b32257e58c"
00011   _type = "nao_msgs/TorsoOdometry"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """# Data from Nao's torso odometry estimate based on joint kinematics
00014 #
00015 # x, y, z: position of torso in odometry frame
00016 # wx, wy, wz: attitude of torso around x, y, z axis
00017 
00018 Header header
00019 
00020 float32 x
00021 float32 y
00022 float32 z
00023 float32 wx
00024 float32 wy
00025 float32 wz
00026 ================================================================================
00027 MSG: std_msgs/Header
00028 # Standard metadata for higher-level stamped data types.
00029 # This is generally used to communicate timestamped data 
00030 # in a particular coordinate frame.
00031 # 
00032 # sequence ID: consecutively increasing ID 
00033 uint32 seq
00034 #Two-integer timestamp that is expressed as:
00035 # * stamp.secs: seconds (stamp_secs) since epoch
00036 # * stamp.nsecs: nanoseconds since stamp_secs
00037 # time-handling sugar is provided by the client library
00038 time stamp
00039 #Frame this data is associated with
00040 # 0: no frame
00041 # 1: global frame
00042 string frame_id
00043 
00044 """
00045   __slots__ = ['header','x','y','z','wx','wy','wz']
00046   _slot_types = ['std_msgs/Header','float32','float32','float32','float32','float32','float32']
00047 
00048   def __init__(self, *args, **kwds):
00049     """
00050     Constructor. Any message fields that are implicitly/explicitly
00051     set to None will be assigned a default value. The recommend
00052     use is keyword arguments as this is more robust to future message
00053     changes.  You cannot mix in-order arguments and keyword arguments.
00054 
00055     The available fields are:
00056        header,x,y,z,wx,wy,wz
00057 
00058     :param args: complete set of field values, in .msg order
00059     :param kwds: use keyword arguments corresponding to message field names
00060     to set specific fields.
00061     """
00062     if args or kwds:
00063       super(TorsoOdometry, self).__init__(*args, **kwds)
00064       #message fields cannot be None, assign default values for those that are
00065       if self.header is None:
00066         self.header = std_msgs.msg.Header()
00067       if self.x is None:
00068         self.x = 0.
00069       if self.y is None:
00070         self.y = 0.
00071       if self.z is None:
00072         self.z = 0.
00073       if self.wx is None:
00074         self.wx = 0.
00075       if self.wy is None:
00076         self.wy = 0.
00077       if self.wz is None:
00078         self.wz = 0.
00079     else:
00080       self.header = std_msgs.msg.Header()
00081       self.x = 0.
00082       self.y = 0.
00083       self.z = 0.
00084       self.wx = 0.
00085       self.wy = 0.
00086       self.wz = 0.
00087 
00088   def _get_types(self):
00089     """
00090     internal API method
00091     """
00092     return self._slot_types
00093 
00094   def serialize(self, buff):
00095     """
00096     serialize message into buffer
00097     :param buff: buffer, ``StringIO``
00098     """
00099     try:
00100       _x = self
00101       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00102       _x = self.header.frame_id
00103       length = len(_x)
00104       if python3 or type(_x) == unicode:
00105         _x = _x.encode('utf-8')
00106         length = len(_x)
00107       buff.write(struct.pack('<I%ss'%length, length, _x))
00108       _x = self
00109       buff.write(_struct_6f.pack(_x.x, _x.y, _x.z, _x.wx, _x.wy, _x.wz))
00110     except struct.error as se: self._check_types(se)
00111     except TypeError as te: self._check_types(te)
00112 
00113   def deserialize(self, str):
00114     """
00115     unpack serialized message in str into this message instance
00116     :param str: byte array of serialized message, ``str``
00117     """
00118     try:
00119       if self.header is None:
00120         self.header = std_msgs.msg.Header()
00121       end = 0
00122       _x = self
00123       start = end
00124       end += 12
00125       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00126       start = end
00127       end += 4
00128       (length,) = _struct_I.unpack(str[start:end])
00129       start = end
00130       end += length
00131       if python3:
00132         self.header.frame_id = str[start:end].decode('utf-8')
00133       else:
00134         self.header.frame_id = str[start:end]
00135       _x = self
00136       start = end
00137       end += 24
00138       (_x.x, _x.y, _x.z, _x.wx, _x.wy, _x.wz,) = _struct_6f.unpack(str[start:end])
00139       return self
00140     except struct.error as e:
00141       raise genpy.DeserializationError(e) #most likely buffer underfill
00142 
00143 
00144   def serialize_numpy(self, buff, numpy):
00145     """
00146     serialize message with numpy array types into buffer
00147     :param buff: buffer, ``StringIO``
00148     :param numpy: numpy python module
00149     """
00150     try:
00151       _x = self
00152       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00153       _x = self.header.frame_id
00154       length = len(_x)
00155       if python3 or type(_x) == unicode:
00156         _x = _x.encode('utf-8')
00157         length = len(_x)
00158       buff.write(struct.pack('<I%ss'%length, length, _x))
00159       _x = self
00160       buff.write(_struct_6f.pack(_x.x, _x.y, _x.z, _x.wx, _x.wy, _x.wz))
00161     except struct.error as se: self._check_types(se)
00162     except TypeError as te: self._check_types(te)
00163 
00164   def deserialize_numpy(self, str, numpy):
00165     """
00166     unpack serialized message in str into this message instance using numpy for array types
00167     :param str: byte array of serialized message, ``str``
00168     :param numpy: numpy python module
00169     """
00170     try:
00171       if self.header is None:
00172         self.header = std_msgs.msg.Header()
00173       end = 0
00174       _x = self
00175       start = end
00176       end += 12
00177       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00178       start = end
00179       end += 4
00180       (length,) = _struct_I.unpack(str[start:end])
00181       start = end
00182       end += length
00183       if python3:
00184         self.header.frame_id = str[start:end].decode('utf-8')
00185       else:
00186         self.header.frame_id = str[start:end]
00187       _x = self
00188       start = end
00189       end += 24
00190       (_x.x, _x.y, _x.z, _x.wx, _x.wy, _x.wz,) = _struct_6f.unpack(str[start:end])
00191       return self
00192     except struct.error as e:
00193       raise genpy.DeserializationError(e) #most likely buffer underfill
00194 
00195 _struct_I = genpy.struct_I
00196 _struct_3I = struct.Struct("<3I")
00197 _struct_6f = struct.Struct("<6f")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


nao_msgs
Author(s): Armin Hornung, Stefan Osswald, Daniel Maier
autogenerated on Tue Oct 15 2013 10:05:22