_constant_move_time.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arm/constant_move_time.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 arm.msg
00008 import genpy
00009 import std_msgs.msg
00010 
00011 class constant_move_time(genpy.Message):
00012   _md5sum = "ce3f840cc123698b1457e9ca4641494a"
00013   _type = "arm/constant_move_time"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """# Constant movement by time message
00016 Header header
00017 time end
00018 constant_move move
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 MSG: arm/constant_move
00039 # Constant movement message
00040 Header header
00041 int8[8] states
00042 int8[7] speeds
00043 bool query
00044 bool quit
00045 """
00046   __slots__ = ['header','end','move']
00047   _slot_types = ['std_msgs/Header','time','arm/constant_move']
00048 
00049   def __init__(self, *args, **kwds):
00050     """
00051     Constructor. Any message fields that are implicitly/explicitly
00052     set to None will be assigned a default value. The recommend
00053     use is keyword arguments as this is more robust to future message
00054     changes.  You cannot mix in-order arguments and keyword arguments.
00055 
00056     The available fields are:
00057        header,end,move
00058 
00059     :param args: complete set of field values, in .msg order
00060     :param kwds: use keyword arguments corresponding to message field names
00061     to set specific fields.
00062     """
00063     if args or kwds:
00064       super(constant_move_time, self).__init__(*args, **kwds)
00065       #message fields cannot be None, assign default values for those that are
00066       if self.header is None:
00067         self.header = std_msgs.msg.Header()
00068       if self.end is None:
00069         self.end = genpy.Time()
00070       if self.move is None:
00071         self.move = arm.msg.constant_move()
00072     else:
00073       self.header = std_msgs.msg.Header()
00074       self.end = genpy.Time()
00075       self.move = arm.msg.constant_move()
00076 
00077   def _get_types(self):
00078     """
00079     internal API method
00080     """
00081     return self._slot_types
00082 
00083   def serialize(self, buff):
00084     """
00085     serialize message into buffer
00086     :param buff: buffer, ``StringIO``
00087     """
00088     try:
00089       _x = self
00090       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00091       _x = self.header.frame_id
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097       _x = self
00098       buff.write(_struct_5I.pack(_x.end.secs, _x.end.nsecs, _x.move.header.seq, _x.move.header.stamp.secs, _x.move.header.stamp.nsecs))
00099       _x = self.move.header.frame_id
00100       length = len(_x)
00101       if python3 or type(_x) == unicode:
00102         _x = _x.encode('utf-8')
00103         length = len(_x)
00104       buff.write(struct.pack('<I%ss'%length, length, _x))
00105       buff.write(_struct_8b.pack(*self.move.states))
00106       buff.write(_struct_7b.pack(*self.move.speeds))
00107       _x = self
00108       buff.write(_struct_2B.pack(_x.move.query, _x.move.quit))
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, ``str``
00116     """
00117     try:
00118       if self.header is None:
00119         self.header = std_msgs.msg.Header()
00120       if self.end is None:
00121         self.end = genpy.Time()
00122       if self.move is None:
00123         self.move = arm.msg.constant_move()
00124       end = 0
00125       _x = self
00126       start = end
00127       end += 12
00128       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00129       start = end
00130       end += 4
00131       (length,) = _struct_I.unpack(str[start:end])
00132       start = end
00133       end += length
00134       if python3:
00135         self.header.frame_id = str[start:end].decode('utf-8')
00136       else:
00137         self.header.frame_id = str[start:end]
00138       _x = self
00139       start = end
00140       end += 20
00141       (_x.end.secs, _x.end.nsecs, _x.move.header.seq, _x.move.header.stamp.secs, _x.move.header.stamp.nsecs,) = _struct_5I.unpack(str[start:end])
00142       start = end
00143       end += 4
00144       (length,) = _struct_I.unpack(str[start:end])
00145       start = end
00146       end += length
00147       if python3:
00148         self.move.header.frame_id = str[start:end].decode('utf-8')
00149       else:
00150         self.move.header.frame_id = str[start:end]
00151       start = end
00152       end += 8
00153       self.move.states = _struct_8b.unpack(str[start:end])
00154       start = end
00155       end += 7
00156       self.move.speeds = _struct_7b.unpack(str[start:end])
00157       _x = self
00158       start = end
00159       end += 2
00160       (_x.move.query, _x.move.quit,) = _struct_2B.unpack(str[start:end])
00161       self.move.query = bool(self.move.query)
00162       self.move.quit = bool(self.move.quit)
00163       self.end.canon()
00164       return self
00165     except struct.error as e:
00166       raise genpy.DeserializationError(e) #most likely buffer underfill
00167 
00168 
00169   def serialize_numpy(self, buff, numpy):
00170     """
00171     serialize message with numpy array types into buffer
00172     :param buff: buffer, ``StringIO``
00173     :param numpy: numpy python module
00174     """
00175     try:
00176       _x = self
00177       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00178       _x = self.header.frame_id
00179       length = len(_x)
00180       if python3 or type(_x) == unicode:
00181         _x = _x.encode('utf-8')
00182         length = len(_x)
00183       buff.write(struct.pack('<I%ss'%length, length, _x))
00184       _x = self
00185       buff.write(_struct_5I.pack(_x.end.secs, _x.end.nsecs, _x.move.header.seq, _x.move.header.stamp.secs, _x.move.header.stamp.nsecs))
00186       _x = self.move.header.frame_id
00187       length = len(_x)
00188       if python3 or type(_x) == unicode:
00189         _x = _x.encode('utf-8')
00190         length = len(_x)
00191       buff.write(struct.pack('<I%ss'%length, length, _x))
00192       buff.write(self.move.states.tostring())
00193       buff.write(self.move.speeds.tostring())
00194       _x = self
00195       buff.write(_struct_2B.pack(_x.move.query, _x.move.quit))
00196     except struct.error as se: self._check_types(se)
00197     except TypeError as te: self._check_types(te)
00198 
00199   def deserialize_numpy(self, str, numpy):
00200     """
00201     unpack serialized message in str into this message instance using numpy for array types
00202     :param str: byte array of serialized message, ``str``
00203     :param numpy: numpy python module
00204     """
00205     try:
00206       if self.header is None:
00207         self.header = std_msgs.msg.Header()
00208       if self.end is None:
00209         self.end = genpy.Time()
00210       if self.move is None:
00211         self.move = arm.msg.constant_move()
00212       end = 0
00213       _x = self
00214       start = end
00215       end += 12
00216       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00217       start = end
00218       end += 4
00219       (length,) = _struct_I.unpack(str[start:end])
00220       start = end
00221       end += length
00222       if python3:
00223         self.header.frame_id = str[start:end].decode('utf-8')
00224       else:
00225         self.header.frame_id = str[start:end]
00226       _x = self
00227       start = end
00228       end += 20
00229       (_x.end.secs, _x.end.nsecs, _x.move.header.seq, _x.move.header.stamp.secs, _x.move.header.stamp.nsecs,) = _struct_5I.unpack(str[start:end])
00230       start = end
00231       end += 4
00232       (length,) = _struct_I.unpack(str[start:end])
00233       start = end
00234       end += length
00235       if python3:
00236         self.move.header.frame_id = str[start:end].decode('utf-8')
00237       else:
00238         self.move.header.frame_id = str[start:end]
00239       start = end
00240       end += 8
00241       self.move.states = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=8)
00242       start = end
00243       end += 7
00244       self.move.speeds = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=7)
00245       _x = self
00246       start = end
00247       end += 2
00248       (_x.move.query, _x.move.quit,) = _struct_2B.unpack(str[start:end])
00249       self.move.query = bool(self.move.query)
00250       self.move.quit = bool(self.move.quit)
00251       self.end.canon()
00252       return self
00253     except struct.error as e:
00254       raise genpy.DeserializationError(e) #most likely buffer underfill
00255 
00256 _struct_I = genpy.struct_I
00257 _struct_8b = struct.Struct("<8b")
00258 _struct_3I = struct.Struct("<3I")
00259 _struct_5I = struct.Struct("<5I")
00260 _struct_7b = struct.Struct("<7b")
00261 _struct_2B = struct.Struct("<2B")


arm
Author(s): Jonathan Hasenzahl
autogenerated on Sun Jan 5 2014 11:12:32