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