00001 """autogenerated by genmsg_py from SteeringState.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import art_msgs.msg
00006 import std_msgs.msg
00007
00008 class SteeringState(roslib.message.Message):
00009 _md5sum = "7bf11da138f80579d285d99bea47f6d3"
00010 _type = "art_msgs/SteeringState"
00011 _has_header = True
00012 _full_text = """# ART steering controller state message
00013
00014 # $Id: SteeringState.msg 1161 2011-03-26 02:10:49Z jack.oquin $
00015
00016 Header header
00017
00018 DriverState driver # driver state
00019 float32 angle # steering angle in degrees
00020 float32 sensor # steering sensor voltage
00021
00022
00023 ================================================================================
00024 MSG: std_msgs/Header
00025 # Standard metadata for higher-level stamped data types.
00026 # This is generally used to communicate timestamped data
00027 # in a particular coordinate frame.
00028 #
00029 # sequence ID: consecutively increasing ID
00030 uint32 seq
00031 #Two-integer timestamp that is expressed as:
00032 # * stamp.secs: seconds (stamp_secs) since epoch
00033 # * stamp.nsecs: nanoseconds since stamp_secs
00034 # time-handling sugar is provided by the client library
00035 time stamp
00036 #Frame this data is associated with
00037 # 0: no frame
00038 # 1: global frame
00039 string frame_id
00040
00041 ================================================================================
00042 MSG: art_msgs/DriverState
00043 # ART driver states -- similar to those in driver_base.
00044
00045 # $Id: DriverState.msg 1161 2011-03-26 02:10:49Z jack.oquin $
00046
00047 # constants
00048 uint32 CLOSED = 0 # Not connected to the hardware
00049 uint32 OPENED = 1 # Passively connected to the hardware
00050 uint32 RUNNING = 2 # Sending hardware commands
00051
00052 uint32 state
00053
00054 """
00055 __slots__ = ['header','driver','angle','sensor']
00056 _slot_types = ['Header','art_msgs/DriverState','float32','float32']
00057
00058 def __init__(self, *args, **kwds):
00059 """
00060 Constructor. Any message fields that are implicitly/explicitly
00061 set to None will be assigned a default value. The recommend
00062 use is keyword arguments as this is more robust to future message
00063 changes. You cannot mix in-order arguments and keyword arguments.
00064
00065 The available fields are:
00066 header,driver,angle,sensor
00067
00068 @param args: complete set of field values, in .msg order
00069 @param kwds: use keyword arguments corresponding to message field names
00070 to set specific fields.
00071 """
00072 if args or kwds:
00073 super(SteeringState, self).__init__(*args, **kwds)
00074
00075 if self.header is None:
00076 self.header = std_msgs.msg._Header.Header()
00077 if self.driver is None:
00078 self.driver = art_msgs.msg.DriverState()
00079 if self.angle is None:
00080 self.angle = 0.
00081 if self.sensor is None:
00082 self.sensor = 0.
00083 else:
00084 self.header = std_msgs.msg._Header.Header()
00085 self.driver = art_msgs.msg.DriverState()
00086 self.angle = 0.
00087 self.sensor = 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
00099 @type buff: StringIO
00100 """
00101 try:
00102 _x = self
00103 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00104 _x = self.header.frame_id
00105 length = len(_x)
00106 buff.write(struct.pack('<I%ss'%length, length, _x))
00107 _x = self
00108 buff.write(_struct_I2f.pack(_x.driver.state, _x.angle, _x.sensor))
00109 except struct.error, se: self._check_types(se)
00110 except TypeError, te: self._check_types(te)
00111
00112 def deserialize(self, str):
00113 """
00114 unpack serialized message in str into this message instance
00115 @param str: byte array of serialized message
00116 @type str: str
00117 """
00118 try:
00119 if self.header is None:
00120 self.header = std_msgs.msg._Header.Header()
00121 if self.driver is None:
00122 self.driver = art_msgs.msg.DriverState()
00123 end = 0
00124 _x = self
00125 start = end
00126 end += 12
00127 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00128 start = end
00129 end += 4
00130 (length,) = _struct_I.unpack(str[start:end])
00131 start = end
00132 end += length
00133 self.header.frame_id = str[start:end]
00134 _x = self
00135 start = end
00136 end += 12
00137 (_x.driver.state, _x.angle, _x.sensor,) = _struct_I2f.unpack(str[start:end])
00138 return self
00139 except struct.error, e:
00140 raise roslib.message.DeserializationError(e)
00141
00142
00143 def serialize_numpy(self, buff, numpy):
00144 """
00145 serialize message with numpy array types into buffer
00146 @param buff: buffer
00147 @type buff: StringIO
00148 @param numpy: numpy python module
00149 @type numpy module
00150 """
00151 try:
00152 _x = self
00153 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00154 _x = self.header.frame_id
00155 length = len(_x)
00156 buff.write(struct.pack('<I%ss'%length, length, _x))
00157 _x = self
00158 buff.write(_struct_I2f.pack(_x.driver.state, _x.angle, _x.sensor))
00159 except struct.error, se: self._check_types(se)
00160 except TypeError, te: self._check_types(te)
00161
00162 def deserialize_numpy(self, str, numpy):
00163 """
00164 unpack serialized message in str into this message instance using numpy for array types
00165 @param str: byte array of serialized message
00166 @type str: str
00167 @param numpy: numpy python module
00168 @type numpy: module
00169 """
00170 try:
00171 if self.header is None:
00172 self.header = std_msgs.msg._Header.Header()
00173 if self.driver is None:
00174 self.driver = art_msgs.msg.DriverState()
00175 end = 0
00176 _x = self
00177 start = end
00178 end += 12
00179 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00180 start = end
00181 end += 4
00182 (length,) = _struct_I.unpack(str[start:end])
00183 start = end
00184 end += length
00185 self.header.frame_id = str[start:end]
00186 _x = self
00187 start = end
00188 end += 12
00189 (_x.driver.state, _x.angle, _x.sensor,) = _struct_I2f.unpack(str[start:end])
00190 return self
00191 except struct.error, e:
00192 raise roslib.message.DeserializationError(e)
00193
00194 _struct_I = roslib.message.struct_I
00195 _struct_3I = struct.Struct("<3I")
00196 _struct_I2f = struct.Struct("<I2f")