_FromMotorDataType.py
Go to the documentation of this file.
00001 """autogenerated by genpy from sr_robot_msgs/FromMotorDataType.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class FromMotorDataType(genpy.Message):
00009   _md5sum = "8524586e34fbd7cb1c08c5f5f1ca0e57"
00010   _type = "sr_robot_msgs/FromMotorDataType"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int16 data
00013 """
00014   __slots__ = ['data']
00015   _slot_types = ['int16']
00016 
00017   def __init__(self, *args, **kwds):
00018     """
00019     Constructor. Any message fields that are implicitly/explicitly
00020     set to None will be assigned a default value. The recommend
00021     use is keyword arguments as this is more robust to future message
00022     changes.  You cannot mix in-order arguments and keyword arguments.
00023 
00024     The available fields are:
00025        data
00026 
00027     :param args: complete set of field values, in .msg order
00028     :param kwds: use keyword arguments corresponding to message field names
00029     to set specific fields.
00030     """
00031     if args or kwds:
00032       super(FromMotorDataType, self).__init__(*args, **kwds)
00033       #message fields cannot be None, assign default values for those that are
00034       if self.data is None:
00035         self.data = 0
00036     else:
00037       self.data = 0
00038 
00039   def _get_types(self):
00040     """
00041     internal API method
00042     """
00043     return self._slot_types
00044 
00045   def serialize(self, buff):
00046     """
00047     serialize message into buffer
00048     :param buff: buffer, ``StringIO``
00049     """
00050     try:
00051       buff.write(_struct_h.pack(self.data))
00052     except struct.error as se: self._check_types(se)
00053     except TypeError as te: self._check_types(te)
00054 
00055   def deserialize(self, str):
00056     """
00057     unpack serialized message in str into this message instance
00058     :param str: byte array of serialized message, ``str``
00059     """
00060     try:
00061       end = 0
00062       start = end
00063       end += 2
00064       (self.data,) = _struct_h.unpack(str[start:end])
00065       return self
00066     except struct.error as e:
00067       raise genpy.DeserializationError(e) #most likely buffer underfill
00068 
00069 
00070   def serialize_numpy(self, buff, numpy):
00071     """
00072     serialize message with numpy array types into buffer
00073     :param buff: buffer, ``StringIO``
00074     :param numpy: numpy python module
00075     """
00076     try:
00077       buff.write(_struct_h.pack(self.data))
00078     except struct.error as se: self._check_types(se)
00079     except TypeError as te: self._check_types(te)
00080 
00081   def deserialize_numpy(self, str, numpy):
00082     """
00083     unpack serialized message in str into this message instance using numpy for array types
00084     :param str: byte array of serialized message, ``str``
00085     :param numpy: numpy python module
00086     """
00087     try:
00088       end = 0
00089       start = end
00090       end += 2
00091       (self.data,) = _struct_h.unpack(str[start:end])
00092       return self
00093     except struct.error as e:
00094       raise genpy.DeserializationError(e) #most likely buffer underfill
00095 
00096 _struct_I = genpy.struct_I
00097 _struct_h = struct.Struct("<h")


sr_robot_msgs
Author(s): Ugo Cupcic/ugo@shadowrobot.com
autogenerated on Fri Jan 3 2014 12:01:40