00001 """autogenerated by genmsg_py from ThrottleCommand.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class ThrottleCommand(roslib.message.Message):
00008 _md5sum = "7d9e24314a55cc39669333e821a84049"
00009 _type = "art_msgs/ThrottleCommand"
00010 _has_header = True
00011 _full_text = """# ART throttle controller command message
00012
00013 # $Id: ThrottleCommand.msg 644 2010-09-28 03:19:07Z jack.oquin $
00014
00015 Header header
00016
00017 # request types
00018 uint32 Absolute = 0 # set absolute position: 0.0 is off, 1.0 is fully on
00019 uint32 Relative = 1 # change relative to current setting, [-1.0 to 1.0]
00020
00021 uint32 request # request type
00022 float32 position # requested position
00023
00024
00025
00026 ================================================================================
00027 MSG: std_msgs/Header
00028 # Standard metadata for higher-level stamped data types.
00029 # This is generally used to communicate timestamped data
00030 # in a particular coordinate frame.
00031 #
00032 # sequence ID: consecutively increasing ID
00033 uint32 seq
00034 #Two-integer timestamp that is expressed as:
00035 # * stamp.secs: seconds (stamp_secs) since epoch
00036 # * stamp.nsecs: nanoseconds since stamp_secs
00037 # time-handling sugar is provided by the client library
00038 time stamp
00039 #Frame this data is associated with
00040 # 0: no frame
00041 # 1: global frame
00042 string frame_id
00043
00044 """
00045
00046 Absolute = 0
00047 Relative = 1
00048
00049 __slots__ = ['header','request','position']
00050 _slot_types = ['Header','uint32','float32']
00051
00052 def __init__(self, *args, **kwds):
00053 """
00054 Constructor. Any message fields that are implicitly/explicitly
00055 set to None will be assigned a default value. The recommend
00056 use is keyword arguments as this is more robust to future message
00057 changes. You cannot mix in-order arguments and keyword arguments.
00058
00059 The available fields are:
00060 header,request,position
00061
00062 @param args: complete set of field values, in .msg order
00063 @param kwds: use keyword arguments corresponding to message field names
00064 to set specific fields.
00065 """
00066 if args or kwds:
00067 super(ThrottleCommand, self).__init__(*args, **kwds)
00068
00069 if self.header is None:
00070 self.header = std_msgs.msg._Header.Header()
00071 if self.request is None:
00072 self.request = 0
00073 if self.position is None:
00074 self.position = 0.
00075 else:
00076 self.header = std_msgs.msg._Header.Header()
00077 self.request = 0
00078 self.position = 0.
00079
00080 def _get_types(self):
00081 """
00082 internal API method
00083 """
00084 return self._slot_types
00085
00086 def serialize(self, buff):
00087 """
00088 serialize message into buffer
00089 @param buff: buffer
00090 @type buff: StringIO
00091 """
00092 try:
00093 _x = self
00094 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00095 _x = self.header.frame_id
00096 length = len(_x)
00097 buff.write(struct.pack('<I%ss'%length, length, _x))
00098 _x = self
00099 buff.write(_struct_If.pack(_x.request, _x.position))
00100 except struct.error, se: self._check_types(se)
00101 except TypeError, te: self._check_types(te)
00102
00103 def deserialize(self, str):
00104 """
00105 unpack serialized message in str into this message instance
00106 @param str: byte array of serialized message
00107 @type str: str
00108 """
00109 try:
00110 if self.header is None:
00111 self.header = std_msgs.msg._Header.Header()
00112 end = 0
00113 _x = self
00114 start = end
00115 end += 12
00116 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00117 start = end
00118 end += 4
00119 (length,) = _struct_I.unpack(str[start:end])
00120 start = end
00121 end += length
00122 self.header.frame_id = str[start:end]
00123 _x = self
00124 start = end
00125 end += 8
00126 (_x.request, _x.position,) = _struct_If.unpack(str[start:end])
00127 return self
00128 except struct.error, e:
00129 raise roslib.message.DeserializationError(e)
00130
00131
00132 def serialize_numpy(self, buff, numpy):
00133 """
00134 serialize message with numpy array types into buffer
00135 @param buff: buffer
00136 @type buff: StringIO
00137 @param numpy: numpy python module
00138 @type numpy module
00139 """
00140 try:
00141 _x = self
00142 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00143 _x = self.header.frame_id
00144 length = len(_x)
00145 buff.write(struct.pack('<I%ss'%length, length, _x))
00146 _x = self
00147 buff.write(_struct_If.pack(_x.request, _x.position))
00148 except struct.error, se: self._check_types(se)
00149 except TypeError, te: self._check_types(te)
00150
00151 def deserialize_numpy(self, str, numpy):
00152 """
00153 unpack serialized message in str into this message instance using numpy for array types
00154 @param str: byte array of serialized message
00155 @type str: str
00156 @param numpy: numpy python module
00157 @type numpy: module
00158 """
00159 try:
00160 if self.header is None:
00161 self.header = std_msgs.msg._Header.Header()
00162 end = 0
00163 _x = self
00164 start = end
00165 end += 12
00166 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 start = end
00171 end += length
00172 self.header.frame_id = str[start:end]
00173 _x = self
00174 start = end
00175 end += 8
00176 (_x.request, _x.position,) = _struct_If.unpack(str[start:end])
00177 return self
00178 except struct.error, e:
00179 raise roslib.message.DeserializationError(e)
00180
00181 _struct_I = roslib.message.struct_I
00182 _struct_3I = struct.Struct("<3I")
00183 _struct_If = struct.Struct("<If")