Go to the documentation of this file.00001 """autogenerated by genpy from komodo_rover/StampedEncoders.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 komodo_rover.msg
00008 import std_msgs.msg
00009
00010 class StampedEncoders(genpy.Message):
00011 _md5sum = "7c217717e3bf9ebebdee0e043bc42e56"
00012 _type = "komodo_rover/StampedEncoders"
00013 _has_header = True
00014 _full_text = """Header header
00015 Encoders encoders
00016
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: komodo_rover/Encoders
00037 float32 time_delta # Time since last encoder update.
00038 int32 left_wheel # Encoder counts (absolute or relative)
00039 int32 right_wheel # Encoder counts (absolute or relative)
00040
00041 """
00042 __slots__ = ['header','encoders']
00043 _slot_types = ['std_msgs/Header','komodo_rover/Encoders']
00044
00045 def __init__(self, *args, **kwds):
00046 """
00047 Constructor. Any message fields that are implicitly/explicitly
00048 set to None will be assigned a default value. The recommend
00049 use is keyword arguments as this is more robust to future message
00050 changes. You cannot mix in-order arguments and keyword arguments.
00051
00052 The available fields are:
00053 header,encoders
00054
00055 :param args: complete set of field values, in .msg order
00056 :param kwds: use keyword arguments corresponding to message field names
00057 to set specific fields.
00058 """
00059 if args or kwds:
00060 super(StampedEncoders, self).__init__(*args, **kwds)
00061
00062 if self.header is None:
00063 self.header = std_msgs.msg.Header()
00064 if self.encoders is None:
00065 self.encoders = komodo_rover.msg.Encoders()
00066 else:
00067 self.header = std_msgs.msg.Header()
00068 self.encoders = komodo_rover.msg.Encoders()
00069
00070 def _get_types(self):
00071 """
00072 internal API method
00073 """
00074 return self._slot_types
00075
00076 def serialize(self, buff):
00077 """
00078 serialize message into buffer
00079 :param buff: buffer, ``StringIO``
00080 """
00081 try:
00082 _x = self
00083 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00084 _x = self.header.frame_id
00085 length = len(_x)
00086 if python3 or type(_x) == unicode:
00087 _x = _x.encode('utf-8')
00088 length = len(_x)
00089 buff.write(struct.pack('<I%ss'%length, length, _x))
00090 _x = self
00091 buff.write(_struct_f2i.pack(_x.encoders.time_delta, _x.encoders.left_wheel, _x.encoders.right_wheel))
00092 except struct.error as se: self._check_types(se)
00093 except TypeError as te: self._check_types(te)
00094
00095 def deserialize(self, str):
00096 """
00097 unpack serialized message in str into this message instance
00098 :param str: byte array of serialized message, ``str``
00099 """
00100 try:
00101 if self.header is None:
00102 self.header = std_msgs.msg.Header()
00103 if self.encoders is None:
00104 self.encoders = komodo_rover.msg.Encoders()
00105 end = 0
00106 _x = self
00107 start = end
00108 end += 12
00109 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00110 start = end
00111 end += 4
00112 (length,) = _struct_I.unpack(str[start:end])
00113 start = end
00114 end += length
00115 if python3:
00116 self.header.frame_id = str[start:end].decode('utf-8')
00117 else:
00118 self.header.frame_id = str[start:end]
00119 _x = self
00120 start = end
00121 end += 12
00122 (_x.encoders.time_delta, _x.encoders.left_wheel, _x.encoders.right_wheel,) = _struct_f2i.unpack(str[start:end])
00123 return self
00124 except struct.error as e:
00125 raise genpy.DeserializationError(e)
00126
00127
00128 def serialize_numpy(self, buff, numpy):
00129 """
00130 serialize message with numpy array types into buffer
00131 :param buff: buffer, ``StringIO``
00132 :param numpy: numpy python module
00133 """
00134 try:
00135 _x = self
00136 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00137 _x = self.header.frame_id
00138 length = len(_x)
00139 if python3 or type(_x) == unicode:
00140 _x = _x.encode('utf-8')
00141 length = len(_x)
00142 buff.write(struct.pack('<I%ss'%length, length, _x))
00143 _x = self
00144 buff.write(_struct_f2i.pack(_x.encoders.time_delta, _x.encoders.left_wheel, _x.encoders.right_wheel))
00145 except struct.error as se: self._check_types(se)
00146 except TypeError as te: self._check_types(te)
00147
00148 def deserialize_numpy(self, str, numpy):
00149 """
00150 unpack serialized message in str into this message instance using numpy for array types
00151 :param str: byte array of serialized message, ``str``
00152 :param numpy: numpy python module
00153 """
00154 try:
00155 if self.header is None:
00156 self.header = std_msgs.msg.Header()
00157 if self.encoders is None:
00158 self.encoders = komodo_rover.msg.Encoders()
00159 end = 0
00160 _x = self
00161 start = end
00162 end += 12
00163 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00164 start = end
00165 end += 4
00166 (length,) = _struct_I.unpack(str[start:end])
00167 start = end
00168 end += length
00169 if python3:
00170 self.header.frame_id = str[start:end].decode('utf-8')
00171 else:
00172 self.header.frame_id = str[start:end]
00173 _x = self
00174 start = end
00175 end += 12
00176 (_x.encoders.time_delta, _x.encoders.left_wheel, _x.encoders.right_wheel,) = _struct_f2i.unpack(str[start:end])
00177 return self
00178 except struct.error as e:
00179 raise genpy.DeserializationError(e)
00180
00181 _struct_I = genpy.struct_I
00182 _struct_3I = struct.Struct("<3I")
00183 _struct_f2i = struct.Struct("<f2i")