00001 """autogenerated by genpy from ackermann_msgs/AckermannDriveStamped.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 ackermann_msgs.msg
00008 import std_msgs.msg
00009
00010 class AckermannDriveStamped(genpy.Message):
00011 _md5sum = "1fd5d7f58889cefd44d29f6653240d0c"
00012 _type = "ackermann_msgs/AckermannDriveStamped"
00013 _has_header = True
00014 _full_text = """## Time stamped drive command for robots with Ackermann steering.
00015 # $Id$
00016
00017 Header header
00018 AckermannDrive drive
00019
00020 ================================================================================
00021 MSG: std_msgs/Header
00022 # Standard metadata for higher-level stamped data types.
00023 # This is generally used to communicate timestamped data
00024 # in a particular coordinate frame.
00025 #
00026 # sequence ID: consecutively increasing ID
00027 uint32 seq
00028 #Two-integer timestamp that is expressed as:
00029 # * stamp.secs: seconds (stamp_secs) since epoch
00030 # * stamp.nsecs: nanoseconds since stamp_secs
00031 # time-handling sugar is provided by the client library
00032 time stamp
00033 #Frame this data is associated with
00034 # 0: no frame
00035 # 1: global frame
00036 string frame_id
00037
00038 ================================================================================
00039 MSG: ackermann_msgs/AckermannDrive
00040 ## Driving command for a car-like vehicle using Ackermann steering.
00041 # $Id$
00042
00043 # Assumes Ackermann front-wheel steering. The left and right front
00044 # wheels are generally at different angles. To simplify, the commanded
00045 # angle corresponds to the yaw of a virtual wheel located at the
00046 # center of the front axle, like on a tricycle. Positive yaw is to
00047 # the left. (This is *not* the angle of the steering wheel inside the
00048 # passenger compartment.)
00049 #
00050 # Zero steering angle velocity means change the steering angle as
00051 # quickly as possible. Positive velocity indicates a desired absolute
00052 # rate of change either left or right. The controller tries not to
00053 # exceed this limit in either direction, but sometimes it might.
00054 #
00055 float32 steering_angle # desired virtual angle (radians)
00056 float32 steering_angle_velocity # desired rate of change (radians/s)
00057
00058 # Drive at requested speed, acceleration and jerk (the 1st, 2nd and
00059 # 3rd derivatives of position). All are measured at the vehicle's
00060 # center of rotation, typically the center of the rear axle. The
00061 # controller tries not to exceed these limits in either direction, but
00062 # sometimes it might.
00063 #
00064 # Speed is the desired scalar magnitude of the velocity vector.
00065 # Direction is forward unless the sign is negative, indicating reverse.
00066 #
00067 # Zero acceleration means change speed as quickly as
00068 # possible. Positive acceleration indicates a desired absolute
00069 # magnitude; that includes deceleration.
00070 #
00071 # Zero jerk means change acceleration as quickly as possible. Positive
00072 # jerk indicates a desired absolute rate of acceleration change in
00073 # either direction (increasing or decreasing).
00074 #
00075 float32 speed # desired forward speed (m/s)
00076 float32 acceleration # desired acceleration (m/s^2)
00077 float32 jerk # desired jerk (m/s^3)
00078
00079 """
00080 __slots__ = ['header','drive']
00081 _slot_types = ['std_msgs/Header','ackermann_msgs/AckermannDrive']
00082
00083 def __init__(self, *args, **kwds):
00084 """
00085 Constructor. Any message fields that are implicitly/explicitly
00086 set to None will be assigned a default value. The recommend
00087 use is keyword arguments as this is more robust to future message
00088 changes. You cannot mix in-order arguments and keyword arguments.
00089
00090 The available fields are:
00091 header,drive
00092
00093 :param args: complete set of field values, in .msg order
00094 :param kwds: use keyword arguments corresponding to message field names
00095 to set specific fields.
00096 """
00097 if args or kwds:
00098 super(AckermannDriveStamped, self).__init__(*args, **kwds)
00099
00100 if self.header is None:
00101 self.header = std_msgs.msg.Header()
00102 if self.drive is None:
00103 self.drive = ackermann_msgs.msg.AckermannDrive()
00104 else:
00105 self.header = std_msgs.msg.Header()
00106 self.drive = ackermann_msgs.msg.AckermannDrive()
00107
00108 def _get_types(self):
00109 """
00110 internal API method
00111 """
00112 return self._slot_types
00113
00114 def serialize(self, buff):
00115 """
00116 serialize message into buffer
00117 :param buff: buffer, ``StringIO``
00118 """
00119 try:
00120 _x = self
00121 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00122 _x = self.header.frame_id
00123 length = len(_x)
00124 if python3 or type(_x) == unicode:
00125 _x = _x.encode('utf-8')
00126 length = len(_x)
00127 buff.write(struct.pack('<I%ss'%length, length, _x))
00128 _x = self
00129 buff.write(_struct_5f.pack(_x.drive.steering_angle, _x.drive.steering_angle_velocity, _x.drive.speed, _x.drive.acceleration, _x.drive.jerk))
00130 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00131 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00132
00133 def deserialize(self, str):
00134 """
00135 unpack serialized message in str into this message instance
00136 :param str: byte array of serialized message, ``str``
00137 """
00138 try:
00139 if self.header is None:
00140 self.header = std_msgs.msg.Header()
00141 if self.drive is None:
00142 self.drive = ackermann_msgs.msg.AckermannDrive()
00143 end = 0
00144 _x = self
00145 start = end
00146 end += 12
00147 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00148 start = end
00149 end += 4
00150 (length,) = _struct_I.unpack(str[start:end])
00151 start = end
00152 end += length
00153 if python3:
00154 self.header.frame_id = str[start:end].decode('utf-8')
00155 else:
00156 self.header.frame_id = str[start:end]
00157 _x = self
00158 start = end
00159 end += 20
00160 (_x.drive.steering_angle, _x.drive.steering_angle_velocity, _x.drive.speed, _x.drive.acceleration, _x.drive.jerk,) = _struct_5f.unpack(str[start:end])
00161 return self
00162 except struct.error as e:
00163 raise genpy.DeserializationError(e)
00164
00165
00166 def serialize_numpy(self, buff, numpy):
00167 """
00168 serialize message with numpy array types into buffer
00169 :param buff: buffer, ``StringIO``
00170 :param numpy: numpy python module
00171 """
00172 try:
00173 _x = self
00174 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00175 _x = self.header.frame_id
00176 length = len(_x)
00177 if python3 or type(_x) == unicode:
00178 _x = _x.encode('utf-8')
00179 length = len(_x)
00180 buff.write(struct.pack('<I%ss'%length, length, _x))
00181 _x = self
00182 buff.write(_struct_5f.pack(_x.drive.steering_angle, _x.drive.steering_angle_velocity, _x.drive.speed, _x.drive.acceleration, _x.drive.jerk))
00183 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00184 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00185
00186 def deserialize_numpy(self, str, numpy):
00187 """
00188 unpack serialized message in str into this message instance using numpy for array types
00189 :param str: byte array of serialized message, ``str``
00190 :param numpy: numpy python module
00191 """
00192 try:
00193 if self.header is None:
00194 self.header = std_msgs.msg.Header()
00195 if self.drive is None:
00196 self.drive = ackermann_msgs.msg.AckermannDrive()
00197 end = 0
00198 _x = self
00199 start = end
00200 end += 12
00201 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 start = end
00206 end += length
00207 if python3:
00208 self.header.frame_id = str[start:end].decode('utf-8')
00209 else:
00210 self.header.frame_id = str[start:end]
00211 _x = self
00212 start = end
00213 end += 20
00214 (_x.drive.steering_angle, _x.drive.steering_angle_velocity, _x.drive.speed, _x.drive.acceleration, _x.drive.jerk,) = _struct_5f.unpack(str[start:end])
00215 return self
00216 except struct.error as e:
00217 raise genpy.DeserializationError(e)
00218
00219 _struct_I = genpy.struct_I
00220 _struct_3I = struct.Struct("<3I")
00221 _struct_5f = struct.Struct("<5f")