_MassStamped.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tk_draft_msgs/MassStamped.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 MassStamped(genpy.Message):
00010   _md5sum = "4f3a125b8254b3dbe253b4bd7ce38d9d"
00011   _type = "tk_draft_msgs/MassStamped"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """#
00014 # Copyright 2011  Antonio Franchi and Martin Riedel    
00015 #
00016 # This file is part of TeleKyb.
00017 #
00018 # TeleKyb is free software: you can redistribute it and/or modify
00019 # it under the terms of the GNU General Public License as published by
00020 # the Free Software Foundation, either version 3 of the License, or
00021 # (at your option) any later version.
00022 #
00023 # TeleKyb is distributed in the hope that it will be useful,
00024 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026 # GNU General Public License for more details.
00027 #
00028 # You should have received a copy of the GNU General Public License
00029 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00030 
00031 # Contains the estimated mass
00032 
00033 Header header
00034 
00035 float64 mass
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   __slots__ = ['header','mass']
00057   _slot_types = ['std_msgs/Header','float64']
00058 
00059   def __init__(self, *args, **kwds):
00060     """
00061     Constructor. Any message fields that are implicitly/explicitly
00062     set to None will be assigned a default value. The recommend
00063     use is keyword arguments as this is more robust to future message
00064     changes.  You cannot mix in-order arguments and keyword arguments.
00065 
00066     The available fields are:
00067        header,mass
00068 
00069     :param args: complete set of field values, in .msg order
00070     :param kwds: use keyword arguments corresponding to message field names
00071     to set specific fields.
00072     """
00073     if args or kwds:
00074       super(MassStamped, self).__init__(*args, **kwds)
00075       #message fields cannot be None, assign default values for those that are
00076       if self.header is None:
00077         self.header = std_msgs.msg.Header()
00078       if self.mass is None:
00079         self.mass = 0.
00080     else:
00081       self.header = std_msgs.msg.Header()
00082       self.mass = 0.
00083 
00084   def _get_types(self):
00085     """
00086     internal API method
00087     """
00088     return self._slot_types
00089 
00090   def serialize(self, buff):
00091     """
00092     serialize message into buffer
00093     :param buff: buffer, ``StringIO``
00094     """
00095     try:
00096       _x = self
00097       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00098       _x = self.header.frame_id
00099       length = len(_x)
00100       if python3 or type(_x) == unicode:
00101         _x = _x.encode('utf-8')
00102         length = len(_x)
00103       buff.write(struct.pack('<I%ss'%length, length, _x))
00104       buff.write(_struct_d.pack(self.mass))
00105     except struct.error as se: self._check_types(se)
00106     except TypeError as te: self._check_types(te)
00107 
00108   def deserialize(self, str):
00109     """
00110     unpack serialized message in str into this message instance
00111     :param str: byte array of serialized message, ``str``
00112     """
00113     try:
00114       if self.header is None:
00115         self.header = std_msgs.msg.Header()
00116       end = 0
00117       _x = self
00118       start = end
00119       end += 12
00120       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00121       start = end
00122       end += 4
00123       (length,) = _struct_I.unpack(str[start:end])
00124       start = end
00125       end += length
00126       if python3:
00127         self.header.frame_id = str[start:end].decode('utf-8')
00128       else:
00129         self.header.frame_id = str[start:end]
00130       start = end
00131       end += 8
00132       (self.mass,) = _struct_d.unpack(str[start:end])
00133       return self
00134     except struct.error as e:
00135       raise genpy.DeserializationError(e) #most likely buffer underfill
00136 
00137 
00138   def serialize_numpy(self, buff, numpy):
00139     """
00140     serialize message with numpy array types into buffer
00141     :param buff: buffer, ``StringIO``
00142     :param numpy: numpy python module
00143     """
00144     try:
00145       _x = self
00146       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00147       _x = self.header.frame_id
00148       length = len(_x)
00149       if python3 or type(_x) == unicode:
00150         _x = _x.encode('utf-8')
00151         length = len(_x)
00152       buff.write(struct.pack('<I%ss'%length, length, _x))
00153       buff.write(_struct_d.pack(self.mass))
00154     except struct.error as se: self._check_types(se)
00155     except TypeError as te: self._check_types(te)
00156 
00157   def deserialize_numpy(self, str, numpy):
00158     """
00159     unpack serialized message in str into this message instance using numpy for array types
00160     :param str: byte array of serialized message, ``str``
00161     :param numpy: numpy python module
00162     """
00163     try:
00164       if self.header is None:
00165         self.header = std_msgs.msg.Header()
00166       end = 0
00167       _x = self
00168       start = end
00169       end += 12
00170       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00171       start = end
00172       end += 4
00173       (length,) = _struct_I.unpack(str[start:end])
00174       start = end
00175       end += length
00176       if python3:
00177         self.header.frame_id = str[start:end].decode('utf-8')
00178       else:
00179         self.header.frame_id = str[start:end]
00180       start = end
00181       end += 8
00182       (self.mass,) = _struct_d.unpack(str[start:end])
00183       return self
00184     except struct.error as e:
00185       raise genpy.DeserializationError(e) #most likely buffer underfill
00186 
00187 _struct_I = genpy.struct_I
00188 _struct_3I = struct.Struct("<3I")
00189 _struct_d = struct.Struct("<d")
 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