00001 """autogenerated by genpy from arm/constant_move.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 std_msgs.msg
00008
00009 class constant_move(genpy.Message):
00010 _md5sum = "87f1d9135e20ae2be6861b3a526c5653"
00011 _type = "arm/constant_move"
00012 _has_header = True
00013 _full_text = """# Constant movement message
00014 Header header
00015 int8[8] states
00016 int8[7] speeds
00017 bool query
00018 bool quit
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data
00023 # in a particular coordinate frame.
00024 #
00025 # sequence ID: consecutively increasing ID
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036
00037 """
00038 __slots__ = ['header','states','speeds','query','quit']
00039 _slot_types = ['std_msgs/Header','int8[8]','int8[7]','bool','bool']
00040
00041 def __init__(self, *args, **kwds):
00042 """
00043 Constructor. Any message fields that are implicitly/explicitly
00044 set to None will be assigned a default value. The recommend
00045 use is keyword arguments as this is more robust to future message
00046 changes. You cannot mix in-order arguments and keyword arguments.
00047
00048 The available fields are:
00049 header,states,speeds,query,quit
00050
00051 :param args: complete set of field values, in .msg order
00052 :param kwds: use keyword arguments corresponding to message field names
00053 to set specific fields.
00054 """
00055 if args or kwds:
00056 super(constant_move, self).__init__(*args, **kwds)
00057
00058 if self.header is None:
00059 self.header = std_msgs.msg.Header()
00060 if self.states is None:
00061 self.states = [0,0,0,0,0,0,0,0]
00062 if self.speeds is None:
00063 self.speeds = [0,0,0,0,0,0,0]
00064 if self.query is None:
00065 self.query = False
00066 if self.quit is None:
00067 self.quit = False
00068 else:
00069 self.header = std_msgs.msg.Header()
00070 self.states = [0,0,0,0,0,0,0,0]
00071 self.speeds = [0,0,0,0,0,0,0]
00072 self.query = False
00073 self.quit = False
00074
00075 def _get_types(self):
00076 """
00077 internal API method
00078 """
00079 return self._slot_types
00080
00081 def serialize(self, buff):
00082 """
00083 serialize message into buffer
00084 :param buff: buffer, ``StringIO``
00085 """
00086 try:
00087 _x = self
00088 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00089 _x = self.header.frame_id
00090 length = len(_x)
00091 if python3 or type(_x) == unicode:
00092 _x = _x.encode('utf-8')
00093 length = len(_x)
00094 buff.write(struct.pack('<I%ss'%length, length, _x))
00095 buff.write(_struct_8b.pack(*self.states))
00096 buff.write(_struct_7b.pack(*self.speeds))
00097 _x = self
00098 buff.write(_struct_2B.pack(_x.query, _x.quit))
00099 except struct.error as se: self._check_types(se)
00100 except TypeError as te: self._check_types(te)
00101
00102 def deserialize(self, str):
00103 """
00104 unpack serialized message in str into this message instance
00105 :param str: byte array of serialized message, ``str``
00106 """
00107 try:
00108 if self.header is None:
00109 self.header = std_msgs.msg.Header()
00110 end = 0
00111 _x = self
00112 start = end
00113 end += 12
00114 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 start = end
00119 end += length
00120 if python3:
00121 self.header.frame_id = str[start:end].decode('utf-8')
00122 else:
00123 self.header.frame_id = str[start:end]
00124 start = end
00125 end += 8
00126 self.states = _struct_8b.unpack(str[start:end])
00127 start = end
00128 end += 7
00129 self.speeds = _struct_7b.unpack(str[start:end])
00130 _x = self
00131 start = end
00132 end += 2
00133 (_x.query, _x.quit,) = _struct_2B.unpack(str[start:end])
00134 self.query = bool(self.query)
00135 self.quit = bool(self.quit)
00136 return self
00137 except struct.error as e:
00138 raise genpy.DeserializationError(e)
00139
00140
00141 def serialize_numpy(self, buff, numpy):
00142 """
00143 serialize message with numpy array types into buffer
00144 :param buff: buffer, ``StringIO``
00145 :param numpy: numpy python module
00146 """
00147 try:
00148 _x = self
00149 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00150 _x = self.header.frame_id
00151 length = len(_x)
00152 if python3 or type(_x) == unicode:
00153 _x = _x.encode('utf-8')
00154 length = len(_x)
00155 buff.write(struct.pack('<I%ss'%length, length, _x))
00156 buff.write(self.states.tostring())
00157 buff.write(self.speeds.tostring())
00158 _x = self
00159 buff.write(_struct_2B.pack(_x.query, _x.quit))
00160 except struct.error as se: self._check_types(se)
00161 except TypeError as te: self._check_types(te)
00162
00163 def deserialize_numpy(self, str, numpy):
00164 """
00165 unpack serialized message in str into this message instance using numpy for array types
00166 :param str: byte array of serialized message, ``str``
00167 :param numpy: numpy python module
00168 """
00169 try:
00170 if self.header is None:
00171 self.header = std_msgs.msg.Header()
00172 end = 0
00173 _x = self
00174 start = end
00175 end += 12
00176 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 if python3:
00183 self.header.frame_id = str[start:end].decode('utf-8')
00184 else:
00185 self.header.frame_id = str[start:end]
00186 start = end
00187 end += 8
00188 self.states = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=8)
00189 start = end
00190 end += 7
00191 self.speeds = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=7)
00192 _x = self
00193 start = end
00194 end += 2
00195 (_x.query, _x.quit,) = _struct_2B.unpack(str[start:end])
00196 self.query = bool(self.query)
00197 self.quit = bool(self.quit)
00198 return self
00199 except struct.error as e:
00200 raise genpy.DeserializationError(e)
00201
00202 _struct_I = genpy.struct_I
00203 _struct_8b = struct.Struct("<8b")
00204 _struct_3I = struct.Struct("<3I")
00205 _struct_7b = struct.Struct("<7b")
00206 _struct_2B = struct.Struct("<2B")