00001 """autogenerated by genmsg_py from CarDrive.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import art_msgs.msg
00006
00007 class CarDrive(roslib.message.Message):
00008 _md5sum = "977b12f7daeec4c2a2276732baf95662"
00009 _type = "art_msgs/CarDrive"
00010 _has_header = False
00011 _full_text = """# Driving command for a car-like vehicle using Ackermann steering.
00012 # $Id: CarDrive.msg 1539 2011-05-09 04:09:20Z jack.oquin $
00013
00014 # Drive at requested speed, acceleration and jerk (the 1st, 2nd and
00015 # 3rd derivatives of position). All are non-negative scalars.
00016 #
00017 # Speed is defined as the scalar magnitude of the velocity
00018 # vector. Direction (forwards or backwards) is determined by the gear.
00019 #
00020 # Zero acceleration means change speed as quickly as
00021 # possible. Positive acceleration may include deceleration as needed
00022 # to match the desired speed. It represents a desired rate and also a
00023 # limit not to exceed.
00024 #
00025 # Zero jerk means change acceleration as quickly as possible. Positive
00026 # jerk describes the desired rate of acceleration change in both
00027 # directions (positive and negative).
00028 #
00029 float32 speed # magnitude of velocity vector (m/s)
00030 float32 acceleration # desired acceleration (m/s^2)
00031 float32 jerk # desired jerk (m/s^3)
00032
00033 # Assumes Ackermann (front-wheel) steering. This angle is the average
00034 # yaw of the two front wheels in the vehicle frame of reference
00035 # (positive left), ignoring their slightly differing angles as if it
00036 # were a tricycle. This is *not* the angle of the steering wheel
00037 # inside the passenger compartment.
00038 #
00039 float32 steering_angle # steering angle (radians)
00040
00041 Gear gear # requested gear (no change if Naught)
00042 PilotBehavior behavior # requested pilot behavior
00043
00044 ================================================================================
00045 MSG: art_msgs/Gear
00046 # ART vehicle transmission gear numbers
00047 #
00048 # Used by several different messages.
00049
00050 # $Id: Gear.msg 1539 2011-05-09 04:09:20Z jack.oquin $
00051
00052 # Gear numbers.
00053 #
00054 # Naught means: reset all Shifter relays; no change of CarDrive gear.
00055 uint8 Naught = 0
00056 uint8 Park = 1
00057 uint8 Reverse = 2
00058 uint8 Neutral = 3
00059 uint8 Drive = 4
00060 uint8 N_gears = 5
00061
00062 uint8 value # requested or reported gear number
00063
00064 ================================================================================
00065 MSG: art_msgs/PilotBehavior
00066 # ART autonomous vehicle pilot node behaviors.
00067 #
00068 # Normally, the pilot node does Run, continually sending commands to
00069 # the servo device actuators and monitoring their state. With Pause,
00070 # the pilot becomes passive, allowing a learning algorithm or human
00071 # controller direct access to those devices. In the Off state,
00072 # various devices are shut down: the transmission in Park, the brake
00073 # released, the throttle at idle. The engine is not turned off, but
00074 # it could be.
00075
00076 # $Id: PilotBehavior.msg 1539 2011-05-09 04:09:20Z jack.oquin $
00077
00078 # Behavior value
00079 uint8 value
00080
00081 # Behavior numbers:
00082 uint8 Run = 0 # normal driving
00083 uint8 Pause = 1 # stop issuing servo commands
00084 uint8 Off = 2 # turn off devices
00085 uint8 N_behaviors = 3
00086
00087 """
00088 __slots__ = ['speed','acceleration','jerk','steering_angle','gear','behavior']
00089 _slot_types = ['float32','float32','float32','float32','art_msgs/Gear','art_msgs/PilotBehavior']
00090
00091 def __init__(self, *args, **kwds):
00092 """
00093 Constructor. Any message fields that are implicitly/explicitly
00094 set to None will be assigned a default value. The recommend
00095 use is keyword arguments as this is more robust to future message
00096 changes. You cannot mix in-order arguments and keyword arguments.
00097
00098 The available fields are:
00099 speed,acceleration,jerk,steering_angle,gear,behavior
00100
00101 @param args: complete set of field values, in .msg order
00102 @param kwds: use keyword arguments corresponding to message field names
00103 to set specific fields.
00104 """
00105 if args or kwds:
00106 super(CarDrive, self).__init__(*args, **kwds)
00107
00108 if self.speed is None:
00109 self.speed = 0.
00110 if self.acceleration is None:
00111 self.acceleration = 0.
00112 if self.jerk is None:
00113 self.jerk = 0.
00114 if self.steering_angle is None:
00115 self.steering_angle = 0.
00116 if self.gear is None:
00117 self.gear = art_msgs.msg.Gear()
00118 if self.behavior is None:
00119 self.behavior = art_msgs.msg.PilotBehavior()
00120 else:
00121 self.speed = 0.
00122 self.acceleration = 0.
00123 self.jerk = 0.
00124 self.steering_angle = 0.
00125 self.gear = art_msgs.msg.Gear()
00126 self.behavior = art_msgs.msg.PilotBehavior()
00127
00128 def _get_types(self):
00129 """
00130 internal API method
00131 """
00132 return self._slot_types
00133
00134 def serialize(self, buff):
00135 """
00136 serialize message into buffer
00137 @param buff: buffer
00138 @type buff: StringIO
00139 """
00140 try:
00141 _x = self
00142 buff.write(_struct_4f2B.pack(_x.speed, _x.acceleration, _x.jerk, _x.steering_angle, _x.gear.value, _x.behavior.value))
00143 except struct.error, se: self._check_types(se)
00144 except TypeError, te: self._check_types(te)
00145
00146 def deserialize(self, str):
00147 """
00148 unpack serialized message in str into this message instance
00149 @param str: byte array of serialized message
00150 @type str: str
00151 """
00152 try:
00153 if self.gear is None:
00154 self.gear = art_msgs.msg.Gear()
00155 if self.behavior is None:
00156 self.behavior = art_msgs.msg.PilotBehavior()
00157 end = 0
00158 _x = self
00159 start = end
00160 end += 18
00161 (_x.speed, _x.acceleration, _x.jerk, _x.steering_angle, _x.gear.value, _x.behavior.value,) = _struct_4f2B.unpack(str[start:end])
00162 return self
00163 except struct.error, e:
00164 raise roslib.message.DeserializationError(e)
00165
00166
00167 def serialize_numpy(self, buff, numpy):
00168 """
00169 serialize message with numpy array types into buffer
00170 @param buff: buffer
00171 @type buff: StringIO
00172 @param numpy: numpy python module
00173 @type numpy module
00174 """
00175 try:
00176 _x = self
00177 buff.write(_struct_4f2B.pack(_x.speed, _x.acceleration, _x.jerk, _x.steering_angle, _x.gear.value, _x.behavior.value))
00178 except struct.error, se: self._check_types(se)
00179 except TypeError, te: self._check_types(te)
00180
00181 def deserialize_numpy(self, str, numpy):
00182 """
00183 unpack serialized message in str into this message instance using numpy for array types
00184 @param str: byte array of serialized message
00185 @type str: str
00186 @param numpy: numpy python module
00187 @type numpy: module
00188 """
00189 try:
00190 if self.gear is None:
00191 self.gear = art_msgs.msg.Gear()
00192 if self.behavior is None:
00193 self.behavior = art_msgs.msg.PilotBehavior()
00194 end = 0
00195 _x = self
00196 start = end
00197 end += 18
00198 (_x.speed, _x.acceleration, _x.jerk, _x.steering_angle, _x.gear.value, _x.behavior.value,) = _struct_4f2B.unpack(str[start:end])
00199 return self
00200 except struct.error, e:
00201 raise roslib.message.DeserializationError(e)
00202
00203 _struct_I = roslib.message.struct_I
00204 _struct_4f2B = struct.Struct("<4f2B")