_IrMsg.py
Go to the documentation of this file.
00001 """autogenerated by genpy from corobot_phidgetIK/IrMsg.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 IrMsg(genpy.Message):
00009   _md5sum = "46919f88799a3d678e8e0d18c2cd02f1"
00010   _type = "corobot_phidgetIK/IrMsg"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """#Deprecated. Prefer to use the one in corobot_msgs package, which is exactly the same
00013 
00014 float32 voltage1
00015 float32 voltage2
00016 float32 range1
00017 float32 range2
00018 
00019 """
00020   __slots__ = ['voltage1','voltage2','range1','range2']
00021   _slot_types = ['float32','float32','float32','float32']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        voltage1,voltage2,range1,range2
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(IrMsg, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.voltage1 is None:
00041         self.voltage1 = 0.
00042       if self.voltage2 is None:
00043         self.voltage2 = 0.
00044       if self.range1 is None:
00045         self.range1 = 0.
00046       if self.range2 is None:
00047         self.range2 = 0.
00048     else:
00049       self.voltage1 = 0.
00050       self.voltage2 = 0.
00051       self.range1 = 0.
00052       self.range2 = 0.
00053 
00054   def _get_types(self):
00055     """
00056     internal API method
00057     """
00058     return self._slot_types
00059 
00060   def serialize(self, buff):
00061     """
00062     serialize message into buffer
00063     :param buff: buffer, ``StringIO``
00064     """
00065     try:
00066       _x = self
00067       buff.write(_struct_4f.pack(_x.voltage1, _x.voltage2, _x.range1, _x.range2))
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       end = 0
00078       _x = self
00079       start = end
00080       end += 16
00081       (_x.voltage1, _x.voltage2, _x.range1, _x.range2,) = _struct_4f.unpack(str[start:end])
00082       return self
00083     except struct.error as e:
00084       raise genpy.DeserializationError(e) #most likely buffer underfill
00085 
00086 
00087   def serialize_numpy(self, buff, numpy):
00088     """
00089     serialize message with numpy array types into buffer
00090     :param buff: buffer, ``StringIO``
00091     :param numpy: numpy python module
00092     """
00093     try:
00094       _x = self
00095       buff.write(_struct_4f.pack(_x.voltage1, _x.voltage2, _x.range1, _x.range2))
00096     except struct.error as se: self._check_types(se)
00097     except TypeError as te: self._check_types(te)
00098 
00099   def deserialize_numpy(self, str, numpy):
00100     """
00101     unpack serialized message in str into this message instance using numpy for array types
00102     :param str: byte array of serialized message, ``str``
00103     :param numpy: numpy python module
00104     """
00105     try:
00106       end = 0
00107       _x = self
00108       start = end
00109       end += 16
00110       (_x.voltage1, _x.voltage2, _x.range1, _x.range2,) = _struct_4f.unpack(str[start:end])
00111       return self
00112     except struct.error as e:
00113       raise genpy.DeserializationError(e) #most likely buffer underfill
00114 
00115 _struct_I = genpy.struct_I
00116 _struct_4f = struct.Struct("<4f")


corobot_phidget_ik
Author(s):
autogenerated on Sun Oct 5 2014 23:18:06