_PilotState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/PilotState.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 import std_msgs.msg
00009 
00010 class PilotState(genpy.Message):
00011   _md5sum = "c177b89612055fab019341d1fcc8bc65"
00012   _type = "art_msgs/PilotState"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """# ART pilot state message
00015 
00016 # $Id: PilotState.msg 1541 2011-05-09 19:07:23Z jack.oquin $
00017 
00018 Header  header
00019 
00020 DriverState pilot               # pilot state
00021 
00022 # current states of individual devices
00023 # (considered CLOSED if device not publishing)
00024 DriverState brake
00025 DriverState imu
00026 DriverState odom
00027 DriverState shifter
00028 DriverState steering
00029 DriverState throttle
00030 
00031 # true if pilot preempted for learning speed control
00032 bool preempted
00033 
00034 # latest commanded goal and current status
00035 CarDrive target                 # current command
00036 CarDrive plan                   # intermediate goal
00037 CarDrive current                # current status
00038 
00039 ================================================================================
00040 MSG: std_msgs/Header
00041 # Standard metadata for higher-level stamped data types.
00042 # This is generally used to communicate timestamped data 
00043 # in a particular coordinate frame.
00044 # 
00045 # sequence ID: consecutively increasing ID 
00046 uint32 seq
00047 #Two-integer timestamp that is expressed as:
00048 # * stamp.secs: seconds (stamp_secs) since epoch
00049 # * stamp.nsecs: nanoseconds since stamp_secs
00050 # time-handling sugar is provided by the client library
00051 time stamp
00052 #Frame this data is associated with
00053 # 0: no frame
00054 # 1: global frame
00055 string frame_id
00056 
00057 ================================================================================
00058 MSG: art_msgs/DriverState
00059 # ART driver states -- similar to those in driver_base.
00060 
00061 # $Id: DriverState.msg 1161 2011-03-26 02:10:49Z jack.oquin $
00062 
00063 # constants
00064 uint32 CLOSED = 0       # Not connected to the hardware
00065 uint32 OPENED = 1       # Passively connected to the hardware
00066 uint32 RUNNING = 2      # Sending hardware commands
00067 
00068 uint32 state
00069 
00070 ================================================================================
00071 MSG: art_msgs/CarDrive
00072 # Driving command for a car-like vehicle using Ackermann steering.
00073 # $Id: CarDrive.msg 1539 2011-05-09 04:09:20Z jack.oquin $
00074 
00075 # Drive at requested speed, acceleration and jerk (the 1st, 2nd and
00076 # 3rd derivatives of position). All are non-negative scalars. 
00077 #
00078 # Speed is defined as the scalar magnitude of the velocity
00079 # vector. Direction (forwards or backwards) is determined by the gear.
00080 #
00081 # Zero acceleration means change speed as quickly as
00082 # possible. Positive acceleration may include deceleration as needed
00083 # to match the desired speed. It represents a desired rate and also a
00084 # limit not to exceed.
00085 #
00086 # Zero jerk means change acceleration as quickly as possible. Positive
00087 # jerk describes the desired rate of acceleration change in both
00088 # directions (positive and negative).
00089 #
00090 float32 speed                   # magnitude of velocity vector (m/s)
00091 float32 acceleration            # desired acceleration (m/s^2)
00092 float32 jerk                    # desired jerk (m/s^3)
00093 
00094 # Assumes Ackermann (front-wheel) steering. This angle is the average
00095 # yaw of the two front wheels in the vehicle frame of reference
00096 # (positive left), ignoring their slightly differing angles as if it
00097 # were a tricycle. This is *not* the angle of the steering wheel
00098 # inside the passenger compartment.
00099 #
00100 float32 steering_angle          # steering angle (radians)
00101 
00102 Gear gear                       # requested gear (no change if Naught)
00103 PilotBehavior behavior          # requested pilot behavior
00104 
00105 ================================================================================
00106 MSG: art_msgs/Gear
00107 # ART vehicle transmission gear numbers
00108 #
00109 # Used by several different messages.
00110 
00111 # $Id: Gear.msg 1539 2011-05-09 04:09:20Z jack.oquin $
00112 
00113 # Gear numbers. 
00114 #
00115 # Naught means: reset all Shifter relays; no change of CarDrive gear.
00116 uint8 Naught = 0
00117 uint8 Park = 1
00118 uint8 Reverse = 2
00119 uint8 Neutral = 3
00120 uint8 Drive = 4
00121 uint8 N_gears = 5
00122 
00123 uint8 value             # requested or reported gear number
00124 
00125 ================================================================================
00126 MSG: art_msgs/PilotBehavior
00127 # ART autonomous vehicle pilot node behaviors.
00128 #
00129 # Normally, the pilot node does Run, continually sending commands to
00130 # the servo device actuators and monitoring their state.  With Pause,
00131 # the pilot becomes passive, allowing a learning algorithm or human
00132 # controller direct access to those devices.  In the Off state,
00133 # various devices are shut down: the transmission in Park, the brake
00134 # released, the throttle at idle.  The engine is not turned off, but
00135 # it could be.
00136 
00137 # $Id: PilotBehavior.msg 1539 2011-05-09 04:09:20Z jack.oquin $
00138 
00139 # Behavior value
00140 uint8 value
00141 
00142 # Behavior numbers:
00143 uint8 Run = 0                   # normal driving
00144 uint8 Pause = 1                 # stop issuing servo commands
00145 uint8 Off = 2                   # turn off devices
00146 uint8 N_behaviors = 3
00147 
00148 """
00149   __slots__ = ['header','pilot','brake','imu','odom','shifter','steering','throttle','preempted','target','plan','current']
00150   _slot_types = ['std_msgs/Header','art_msgs/DriverState','art_msgs/DriverState','art_msgs/DriverState','art_msgs/DriverState','art_msgs/DriverState','art_msgs/DriverState','art_msgs/DriverState','bool','art_msgs/CarDrive','art_msgs/CarDrive','art_msgs/CarDrive']
00151 
00152   def __init__(self, *args, **kwds):
00153     """
00154     Constructor. Any message fields that are implicitly/explicitly
00155     set to None will be assigned a default value. The recommend
00156     use is keyword arguments as this is more robust to future message
00157     changes.  You cannot mix in-order arguments and keyword arguments.
00158 
00159     The available fields are:
00160        header,pilot,brake,imu,odom,shifter,steering,throttle,preempted,target,plan,current
00161 
00162     :param args: complete set of field values, in .msg order
00163     :param kwds: use keyword arguments corresponding to message field names
00164     to set specific fields.
00165     """
00166     if args or kwds:
00167       super(PilotState, self).__init__(*args, **kwds)
00168       #message fields cannot be None, assign default values for those that are
00169       if self.header is None:
00170         self.header = std_msgs.msg.Header()
00171       if self.pilot is None:
00172         self.pilot = art_msgs.msg.DriverState()
00173       if self.brake is None:
00174         self.brake = art_msgs.msg.DriverState()
00175       if self.imu is None:
00176         self.imu = art_msgs.msg.DriverState()
00177       if self.odom is None:
00178         self.odom = art_msgs.msg.DriverState()
00179       if self.shifter is None:
00180         self.shifter = art_msgs.msg.DriverState()
00181       if self.steering is None:
00182         self.steering = art_msgs.msg.DriverState()
00183       if self.throttle is None:
00184         self.throttle = art_msgs.msg.DriverState()
00185       if self.preempted is None:
00186         self.preempted = False
00187       if self.target is None:
00188         self.target = art_msgs.msg.CarDrive()
00189       if self.plan is None:
00190         self.plan = art_msgs.msg.CarDrive()
00191       if self.current is None:
00192         self.current = art_msgs.msg.CarDrive()
00193     else:
00194       self.header = std_msgs.msg.Header()
00195       self.pilot = art_msgs.msg.DriverState()
00196       self.brake = art_msgs.msg.DriverState()
00197       self.imu = art_msgs.msg.DriverState()
00198       self.odom = art_msgs.msg.DriverState()
00199       self.shifter = art_msgs.msg.DriverState()
00200       self.steering = art_msgs.msg.DriverState()
00201       self.throttle = art_msgs.msg.DriverState()
00202       self.preempted = False
00203       self.target = art_msgs.msg.CarDrive()
00204       self.plan = art_msgs.msg.CarDrive()
00205       self.current = art_msgs.msg.CarDrive()
00206 
00207   def _get_types(self):
00208     """
00209     internal API method
00210     """
00211     return self._slot_types
00212 
00213   def serialize(self, buff):
00214     """
00215     serialize message into buffer
00216     :param buff: buffer, ``StringIO``
00217     """
00218     try:
00219       _x = self
00220       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00221       _x = self.header.frame_id
00222       length = len(_x)
00223       if python3 or type(_x) == unicode:
00224         _x = _x.encode('utf-8')
00225         length = len(_x)
00226       buff.write(struct.pack('<I%ss'%length, length, _x))
00227       _x = self
00228       buff.write(_struct_7IB4f2B4f2B4f2B.pack(_x.pilot.state, _x.brake.state, _x.imu.state, _x.odom.state, _x.shifter.state, _x.steering.state, _x.throttle.state, _x.preempted, _x.target.speed, _x.target.acceleration, _x.target.jerk, _x.target.steering_angle, _x.target.gear.value, _x.target.behavior.value, _x.plan.speed, _x.plan.acceleration, _x.plan.jerk, _x.plan.steering_angle, _x.plan.gear.value, _x.plan.behavior.value, _x.current.speed, _x.current.acceleration, _x.current.jerk, _x.current.steering_angle, _x.current.gear.value, _x.current.behavior.value))
00229     except struct.error as se: self._check_types(se)
00230     except TypeError as te: self._check_types(te)
00231 
00232   def deserialize(self, str):
00233     """
00234     unpack serialized message in str into this message instance
00235     :param str: byte array of serialized message, ``str``
00236     """
00237     try:
00238       if self.header is None:
00239         self.header = std_msgs.msg.Header()
00240       if self.pilot is None:
00241         self.pilot = art_msgs.msg.DriverState()
00242       if self.brake is None:
00243         self.brake = art_msgs.msg.DriverState()
00244       if self.imu is None:
00245         self.imu = art_msgs.msg.DriverState()
00246       if self.odom is None:
00247         self.odom = art_msgs.msg.DriverState()
00248       if self.shifter is None:
00249         self.shifter = art_msgs.msg.DriverState()
00250       if self.steering is None:
00251         self.steering = art_msgs.msg.DriverState()
00252       if self.throttle is None:
00253         self.throttle = art_msgs.msg.DriverState()
00254       if self.target is None:
00255         self.target = art_msgs.msg.CarDrive()
00256       if self.plan is None:
00257         self.plan = art_msgs.msg.CarDrive()
00258       if self.current is None:
00259         self.current = art_msgs.msg.CarDrive()
00260       end = 0
00261       _x = self
00262       start = end
00263       end += 12
00264       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00265       start = end
00266       end += 4
00267       (length,) = _struct_I.unpack(str[start:end])
00268       start = end
00269       end += length
00270       if python3:
00271         self.header.frame_id = str[start:end].decode('utf-8')
00272       else:
00273         self.header.frame_id = str[start:end]
00274       _x = self
00275       start = end
00276       end += 83
00277       (_x.pilot.state, _x.brake.state, _x.imu.state, _x.odom.state, _x.shifter.state, _x.steering.state, _x.throttle.state, _x.preempted, _x.target.speed, _x.target.acceleration, _x.target.jerk, _x.target.steering_angle, _x.target.gear.value, _x.target.behavior.value, _x.plan.speed, _x.plan.acceleration, _x.plan.jerk, _x.plan.steering_angle, _x.plan.gear.value, _x.plan.behavior.value, _x.current.speed, _x.current.acceleration, _x.current.jerk, _x.current.steering_angle, _x.current.gear.value, _x.current.behavior.value,) = _struct_7IB4f2B4f2B4f2B.unpack(str[start:end])
00278       self.preempted = bool(self.preempted)
00279       return self
00280     except struct.error as e:
00281       raise genpy.DeserializationError(e) #most likely buffer underfill
00282 
00283 
00284   def serialize_numpy(self, buff, numpy):
00285     """
00286     serialize message with numpy array types into buffer
00287     :param buff: buffer, ``StringIO``
00288     :param numpy: numpy python module
00289     """
00290     try:
00291       _x = self
00292       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00293       _x = self.header.frame_id
00294       length = len(_x)
00295       if python3 or type(_x) == unicode:
00296         _x = _x.encode('utf-8')
00297         length = len(_x)
00298       buff.write(struct.pack('<I%ss'%length, length, _x))
00299       _x = self
00300       buff.write(_struct_7IB4f2B4f2B4f2B.pack(_x.pilot.state, _x.brake.state, _x.imu.state, _x.odom.state, _x.shifter.state, _x.steering.state, _x.throttle.state, _x.preempted, _x.target.speed, _x.target.acceleration, _x.target.jerk, _x.target.steering_angle, _x.target.gear.value, _x.target.behavior.value, _x.plan.speed, _x.plan.acceleration, _x.plan.jerk, _x.plan.steering_angle, _x.plan.gear.value, _x.plan.behavior.value, _x.current.speed, _x.current.acceleration, _x.current.jerk, _x.current.steering_angle, _x.current.gear.value, _x.current.behavior.value))
00301     except struct.error as se: self._check_types(se)
00302     except TypeError as te: self._check_types(te)
00303 
00304   def deserialize_numpy(self, str, numpy):
00305     """
00306     unpack serialized message in str into this message instance using numpy for array types
00307     :param str: byte array of serialized message, ``str``
00308     :param numpy: numpy python module
00309     """
00310     try:
00311       if self.header is None:
00312         self.header = std_msgs.msg.Header()
00313       if self.pilot is None:
00314         self.pilot = art_msgs.msg.DriverState()
00315       if self.brake is None:
00316         self.brake = art_msgs.msg.DriverState()
00317       if self.imu is None:
00318         self.imu = art_msgs.msg.DriverState()
00319       if self.odom is None:
00320         self.odom = art_msgs.msg.DriverState()
00321       if self.shifter is None:
00322         self.shifter = art_msgs.msg.DriverState()
00323       if self.steering is None:
00324         self.steering = art_msgs.msg.DriverState()
00325       if self.throttle is None:
00326         self.throttle = art_msgs.msg.DriverState()
00327       if self.target is None:
00328         self.target = art_msgs.msg.CarDrive()
00329       if self.plan is None:
00330         self.plan = art_msgs.msg.CarDrive()
00331       if self.current is None:
00332         self.current = art_msgs.msg.CarDrive()
00333       end = 0
00334       _x = self
00335       start = end
00336       end += 12
00337       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00338       start = end
00339       end += 4
00340       (length,) = _struct_I.unpack(str[start:end])
00341       start = end
00342       end += length
00343       if python3:
00344         self.header.frame_id = str[start:end].decode('utf-8')
00345       else:
00346         self.header.frame_id = str[start:end]
00347       _x = self
00348       start = end
00349       end += 83
00350       (_x.pilot.state, _x.brake.state, _x.imu.state, _x.odom.state, _x.shifter.state, _x.steering.state, _x.throttle.state, _x.preempted, _x.target.speed, _x.target.acceleration, _x.target.jerk, _x.target.steering_angle, _x.target.gear.value, _x.target.behavior.value, _x.plan.speed, _x.plan.acceleration, _x.plan.jerk, _x.plan.steering_angle, _x.plan.gear.value, _x.plan.behavior.value, _x.current.speed, _x.current.acceleration, _x.current.jerk, _x.current.steering_angle, _x.current.gear.value, _x.current.behavior.value,) = _struct_7IB4f2B4f2B4f2B.unpack(str[start:end])
00351       self.preempted = bool(self.preempted)
00352       return self
00353     except struct.error as e:
00354       raise genpy.DeserializationError(e) #most likely buffer underfill
00355 
00356 _struct_I = genpy.struct_I
00357 _struct_3I = struct.Struct("<3I")
00358 _struct_7IB4f2B4f2B4f2B = struct.Struct("<7IB4f2B4f2B4f2B")


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