_ManualBBEstimationFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_assisted_arm_navigation_msgs/ManualBBEstimationFeedback.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 genpy
00008 
00009 class ManualBBEstimationFeedback(genpy.Message):
00010   _md5sum = "d31ce382f901a080bff420c1b6767fec"
00011   _type = "srs_assisted_arm_navigation_msgs/ManualBBEstimationFeedback"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 # feedback
00015 time timestamp
00016 int16[2] p1
00017 int16[2] p2
00018 
00019 
00020 """
00021   __slots__ = ['timestamp','p1','p2']
00022   _slot_types = ['time','int16[2]','int16[2]']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        timestamp,p1,p2
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(ManualBBEstimationFeedback, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.timestamp is None:
00042         self.timestamp = genpy.Time()
00043       if self.p1 is None:
00044         self.p1 = [0,0]
00045       if self.p2 is None:
00046         self.p2 = [0,0]
00047     else:
00048       self.timestamp = genpy.Time()
00049       self.p1 = [0,0]
00050       self.p2 = [0,0]
00051 
00052   def _get_types(self):
00053     """
00054     internal API method
00055     """
00056     return self._slot_types
00057 
00058   def serialize(self, buff):
00059     """
00060     serialize message into buffer
00061     :param buff: buffer, ``StringIO``
00062     """
00063     try:
00064       _x = self
00065       buff.write(_struct_2I.pack(_x.timestamp.secs, _x.timestamp.nsecs))
00066       buff.write(_struct_2h.pack(*self.p1))
00067       buff.write(_struct_2h.pack(*self.p2))
00068     except struct.error as se: self._check_types(se)
00069     except TypeError as te: self._check_types(te)
00070 
00071   def deserialize(self, str):
00072     """
00073     unpack serialized message in str into this message instance
00074     :param str: byte array of serialized message, ``str``
00075     """
00076     try:
00077       if self.timestamp is None:
00078         self.timestamp = genpy.Time()
00079       end = 0
00080       _x = self
00081       start = end
00082       end += 8
00083       (_x.timestamp.secs, _x.timestamp.nsecs,) = _struct_2I.unpack(str[start:end])
00084       start = end
00085       end += 4
00086       self.p1 = _struct_2h.unpack(str[start:end])
00087       start = end
00088       end += 4
00089       self.p2 = _struct_2h.unpack(str[start:end])
00090       self.timestamp.canon()
00091       return self
00092     except struct.error as e:
00093       raise genpy.DeserializationError(e) #most likely buffer underfill
00094 
00095 
00096   def serialize_numpy(self, buff, numpy):
00097     """
00098     serialize message with numpy array types into buffer
00099     :param buff: buffer, ``StringIO``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       _x = self
00104       buff.write(_struct_2I.pack(_x.timestamp.secs, _x.timestamp.nsecs))
00105       buff.write(self.p1.tostring())
00106       buff.write(self.p2.tostring())
00107     except struct.error as se: self._check_types(se)
00108     except TypeError as te: self._check_types(te)
00109 
00110   def deserialize_numpy(self, str, numpy):
00111     """
00112     unpack serialized message in str into this message instance using numpy for array types
00113     :param str: byte array of serialized message, ``str``
00114     :param numpy: numpy python module
00115     """
00116     try:
00117       if self.timestamp is None:
00118         self.timestamp = genpy.Time()
00119       end = 0
00120       _x = self
00121       start = end
00122       end += 8
00123       (_x.timestamp.secs, _x.timestamp.nsecs,) = _struct_2I.unpack(str[start:end])
00124       start = end
00125       end += 4
00126       self.p1 = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=2)
00127       start = end
00128       end += 4
00129       self.p2 = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=2)
00130       self.timestamp.canon()
00131       return self
00132     except struct.error as e:
00133       raise genpy.DeserializationError(e) #most likely buffer underfill
00134 
00135 _struct_I = genpy.struct_I
00136 _struct_2h = struct.Struct("<2h")
00137 _struct_2I = struct.Struct("<2I")


srs_assisted_arm_navigation_msgs
Author(s): Zdenek Materna
autogenerated on Sun Jan 5 2014 11:52:58