_AckermannDrive.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ackermann_msgs/AckermannDrive.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class AckermannDrive(genpy.Message):
00009   _md5sum = "3512e91b48d69674a0e86fadf1ea8231"
00010   _type = "ackermann_msgs/AckermannDrive"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """## Driving command for a car-like vehicle using Ackermann steering.
00013 #  $Id$
00014 
00015 # Assumes Ackermann front-wheel steering. The left and right front
00016 # wheels are generally at different angles. To simplify, the commanded
00017 # angle corresponds to the yaw of a virtual wheel located at the
00018 # center of the front axle, like on a tricycle.  Positive yaw is to
00019 # the left. (This is *not* the angle of the steering wheel inside the
00020 # passenger compartment.)
00021 #
00022 # Zero steering angle velocity means change the steering angle as
00023 # quickly as possible. Positive velocity indicates a desired absolute
00024 # rate of change either left or right. The controller tries not to
00025 # exceed this limit in either direction, but sometimes it might.
00026 #
00027 float32 steering_angle          # desired virtual angle (radians)
00028 float32 steering_angle_velocity # desired rate of change (radians/s)
00029 
00030 # Drive at requested speed, acceleration and jerk (the 1st, 2nd and
00031 # 3rd derivatives of position). All are measured at the vehicle's
00032 # center of rotation, typically the center of the rear axle. The
00033 # controller tries not to exceed these limits in either direction, but
00034 # sometimes it might.
00035 #
00036 # Speed is the desired scalar magnitude of the velocity vector.
00037 # Direction is forward unless the sign is negative, indicating reverse.
00038 #
00039 # Zero acceleration means change speed as quickly as
00040 # possible. Positive acceleration indicates a desired absolute
00041 # magnitude; that includes deceleration.
00042 #
00043 # Zero jerk means change acceleration as quickly as possible. Positive
00044 # jerk indicates a desired absolute rate of acceleration change in
00045 # either direction (increasing or decreasing).
00046 #
00047 float32 speed                   # desired forward speed (m/s)
00048 float32 acceleration            # desired acceleration (m/s^2)
00049 float32 jerk                    # desired jerk (m/s^3)
00050 
00051 """
00052   __slots__ = ['steering_angle','steering_angle_velocity','speed','acceleration','jerk']
00053   _slot_types = ['float32','float32','float32','float32','float32']
00054 
00055   def __init__(self, *args, **kwds):
00056     """
00057     Constructor. Any message fields that are implicitly/explicitly
00058     set to None will be assigned a default value. The recommend
00059     use is keyword arguments as this is more robust to future message
00060     changes.  You cannot mix in-order arguments and keyword arguments.
00061 
00062     The available fields are:
00063        steering_angle,steering_angle_velocity,speed,acceleration,jerk
00064 
00065     :param args: complete set of field values, in .msg order
00066     :param kwds: use keyword arguments corresponding to message field names
00067     to set specific fields.
00068     """
00069     if args or kwds:
00070       super(AckermannDrive, self).__init__(*args, **kwds)
00071       #message fields cannot be None, assign default values for those that are
00072       if self.steering_angle is None:
00073         self.steering_angle = 0.
00074       if self.steering_angle_velocity is None:
00075         self.steering_angle_velocity = 0.
00076       if self.speed is None:
00077         self.speed = 0.
00078       if self.acceleration is None:
00079         self.acceleration = 0.
00080       if self.jerk is None:
00081         self.jerk = 0.
00082     else:
00083       self.steering_angle = 0.
00084       self.steering_angle_velocity = 0.
00085       self.speed = 0.
00086       self.acceleration = 0.
00087       self.jerk = 0.
00088 
00089   def _get_types(self):
00090     """
00091     internal API method
00092     """
00093     return self._slot_types
00094 
00095   def serialize(self, buff):
00096     """
00097     serialize message into buffer
00098     :param buff: buffer, ``StringIO``
00099     """
00100     try:
00101       _x = self
00102       buff.write(_struct_5f.pack(_x.steering_angle, _x.steering_angle_velocity, _x.speed, _x.acceleration, _x.jerk))
00103     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00104     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00105 
00106   def deserialize(self, str):
00107     """
00108     unpack serialized message in str into this message instance
00109     :param str: byte array of serialized message, ``str``
00110     """
00111     try:
00112       end = 0
00113       _x = self
00114       start = end
00115       end += 20
00116       (_x.steering_angle, _x.steering_angle_velocity, _x.speed, _x.acceleration, _x.jerk,) = _struct_5f.unpack(str[start:end])
00117       return self
00118     except struct.error as e:
00119       raise genpy.DeserializationError(e) #most likely buffer underfill
00120 
00121 
00122   def serialize_numpy(self, buff, numpy):
00123     """
00124     serialize message with numpy array types into buffer
00125     :param buff: buffer, ``StringIO``
00126     :param numpy: numpy python module
00127     """
00128     try:
00129       _x = self
00130       buff.write(_struct_5f.pack(_x.steering_angle, _x.steering_angle_velocity, _x.speed, _x.acceleration, _x.jerk))
00131     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00132     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00133 
00134   def deserialize_numpy(self, str, numpy):
00135     """
00136     unpack serialized message in str into this message instance using numpy for array types
00137     :param str: byte array of serialized message, ``str``
00138     :param numpy: numpy python module
00139     """
00140     try:
00141       end = 0
00142       _x = self
00143       start = end
00144       end += 20
00145       (_x.steering_angle, _x.steering_angle_velocity, _x.speed, _x.acceleration, _x.jerk,) = _struct_5f.unpack(str[start:end])
00146       return self
00147     except struct.error as e:
00148       raise genpy.DeserializationError(e) #most likely buffer underfill
00149 
00150 _struct_I = genpy.struct_I
00151 _struct_5f = struct.Struct("<5f")


ackermann_msgs
Author(s): Jack O'Quin
autogenerated on Sun Oct 5 2014 22:05:24