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