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


art_msgs
Author(s): Jack O'Quin
autogenerated on Fri Jan 3 2014 11:08:05