$search
00001 """autogenerated by genmsg_py from ControllerState.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class ControllerState(roslib.message.Message): 00008 _md5sum = "a0f668496c9bbf505c01f59674f2a0c2" 00009 _type = "hector_uav_msgs/ControllerState" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """Header header 00012 uint8 source 00013 00014 uint8 mode 00015 uint8 MOTORS = 1 00016 uint8 ATTITUDE = 2 00017 uint8 VELOCITY = 4 00018 uint8 POSITION = 8 00019 uint8 HEADING = 16 00020 uint8 HEIGHT = 32 00021 00022 uint8 state 00023 uint8 MOTORS_RUNNING = 1 00024 uint8 AIRBORNE = 2 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 # Pseudo-constants 00046 MOTORS = 1 00047 ATTITUDE = 2 00048 VELOCITY = 4 00049 POSITION = 8 00050 HEADING = 16 00051 HEIGHT = 32 00052 MOTORS_RUNNING = 1 00053 AIRBORNE = 2 00054 00055 __slots__ = ['header','source','mode','state'] 00056 _slot_types = ['Header','uint8','uint8','uint8'] 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,source,mode,state 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(ControllerState, self).__init__(*args, **kwds) 00074 #message fields cannot be None, assign default values for those that are 00075 if self.header is None: 00076 self.header = std_msgs.msg._Header.Header() 00077 if self.source is None: 00078 self.source = 0 00079 if self.mode is None: 00080 self.mode = 0 00081 if self.state is None: 00082 self.state = 0 00083 else: 00084 self.header = std_msgs.msg._Header.Header() 00085 self.source = 0 00086 self.mode = 0 00087 self.state = 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_3B.pack(_x.source, _x.mode, _x.state)) 00109 except struct.error as se: self._check_types(se) 00110 except TypeError as 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 end = 0 00122 _x = self 00123 start = end 00124 end += 12 00125 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00126 start = end 00127 end += 4 00128 (length,) = _struct_I.unpack(str[start:end]) 00129 start = end 00130 end += length 00131 self.header.frame_id = str[start:end] 00132 _x = self 00133 start = end 00134 end += 3 00135 (_x.source, _x.mode, _x.state,) = _struct_3B.unpack(str[start:end]) 00136 return self 00137 except struct.error as e: 00138 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00139 00140 00141 def serialize_numpy(self, buff, numpy): 00142 """ 00143 serialize message with numpy array types into buffer 00144 @param buff: buffer 00145 @type buff: StringIO 00146 @param numpy: numpy python module 00147 @type numpy module 00148 """ 00149 try: 00150 _x = self 00151 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00152 _x = self.header.frame_id 00153 length = len(_x) 00154 buff.write(struct.pack('<I%ss'%length, length, _x)) 00155 _x = self 00156 buff.write(_struct_3B.pack(_x.source, _x.mode, _x.state)) 00157 except struct.error as se: self._check_types(se) 00158 except TypeError as te: self._check_types(te) 00159 00160 def deserialize_numpy(self, str, numpy): 00161 """ 00162 unpack serialized message in str into this message instance using numpy for array types 00163 @param str: byte array of serialized message 00164 @type str: str 00165 @param numpy: numpy python module 00166 @type numpy: module 00167 """ 00168 try: 00169 if self.header is None: 00170 self.header = std_msgs.msg._Header.Header() 00171 end = 0 00172 _x = self 00173 start = end 00174 end += 12 00175 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00176 start = end 00177 end += 4 00178 (length,) = _struct_I.unpack(str[start:end]) 00179 start = end 00180 end += length 00181 self.header.frame_id = str[start:end] 00182 _x = self 00183 start = end 00184 end += 3 00185 (_x.source, _x.mode, _x.state,) = _struct_3B.unpack(str[start:end]) 00186 return self 00187 except struct.error as e: 00188 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00189 00190 _struct_I = roslib.message.struct_I 00191 _struct_3B = struct.Struct("<3B") 00192 _struct_3I = struct.Struct("<3I")