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