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