_ActuatorInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from sr_edc_ethercat_drivers/ActuatorInfo.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 ActuatorInfo(genpy.Message):
00009   _md5sum = "b69309b2980b8b35e7e2b52bad59330a"
00010   _type = "sr_edc_ethercat_drivers/ActuatorInfo"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string name
00013 float64 slow_motor_current_limit
00014 float64 quick_motor_current_limit
00015 float64 duty_limit
00016 float64 max_duty
00017 """
00018   __slots__ = ['name','slow_motor_current_limit','quick_motor_current_limit','duty_limit','max_duty']
00019   _slot_types = ['string','float64','float64','float64','float64']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        name,slow_motor_current_limit,quick_motor_current_limit,duty_limit,max_duty
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(ActuatorInfo, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.name is None:
00039         self.name = ''
00040       if self.slow_motor_current_limit is None:
00041         self.slow_motor_current_limit = 0.
00042       if self.quick_motor_current_limit is None:
00043         self.quick_motor_current_limit = 0.
00044       if self.duty_limit is None:
00045         self.duty_limit = 0.
00046       if self.max_duty is None:
00047         self.max_duty = 0.
00048     else:
00049       self.name = ''
00050       self.slow_motor_current_limit = 0.
00051       self.quick_motor_current_limit = 0.
00052       self.duty_limit = 0.
00053       self.max_duty = 0.
00054 
00055   def _get_types(self):
00056     """
00057     internal API method
00058     """
00059     return self._slot_types
00060 
00061   def serialize(self, buff):
00062     """
00063     serialize message into buffer
00064     :param buff: buffer, ``StringIO``
00065     """
00066     try:
00067       _x = self.name
00068       length = len(_x)
00069       if python3 or type(_x) == unicode:
00070         _x = _x.encode('utf-8')
00071         length = len(_x)
00072       buff.write(struct.pack('<I%ss'%length, length, _x))
00073       _x = self
00074       buff.write(_struct_4d.pack(_x.slow_motor_current_limit, _x.quick_motor_current_limit, _x.duty_limit, _x.max_duty))
00075     except struct.error as se: self._check_types(se)
00076     except TypeError as te: self._check_types(te)
00077 
00078   def deserialize(self, str):
00079     """
00080     unpack serialized message in str into this message instance
00081     :param str: byte array of serialized message, ``str``
00082     """
00083     try:
00084       end = 0
00085       start = end
00086       end += 4
00087       (length,) = _struct_I.unpack(str[start:end])
00088       start = end
00089       end += length
00090       if python3:
00091         self.name = str[start:end].decode('utf-8')
00092       else:
00093         self.name = str[start:end]
00094       _x = self
00095       start = end
00096       end += 32
00097       (_x.slow_motor_current_limit, _x.quick_motor_current_limit, _x.duty_limit, _x.max_duty,) = _struct_4d.unpack(str[start:end])
00098       return self
00099     except struct.error as e:
00100       raise genpy.DeserializationError(e) #most likely buffer underfill
00101 
00102 
00103   def serialize_numpy(self, buff, numpy):
00104     """
00105     serialize message with numpy array types into buffer
00106     :param buff: buffer, ``StringIO``
00107     :param numpy: numpy python module
00108     """
00109     try:
00110       _x = self.name
00111       length = len(_x)
00112       if python3 or type(_x) == unicode:
00113         _x = _x.encode('utf-8')
00114         length = len(_x)
00115       buff.write(struct.pack('<I%ss'%length, length, _x))
00116       _x = self
00117       buff.write(_struct_4d.pack(_x.slow_motor_current_limit, _x.quick_motor_current_limit, _x.duty_limit, _x.max_duty))
00118     except struct.error as se: self._check_types(se)
00119     except TypeError as te: self._check_types(te)
00120 
00121   def deserialize_numpy(self, str, numpy):
00122     """
00123     unpack serialized message in str into this message instance using numpy for array types
00124     :param str: byte array of serialized message, ``str``
00125     :param numpy: numpy python module
00126     """
00127     try:
00128       end = 0
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.name = str[start:end].decode('utf-8')
00136       else:
00137         self.name = str[start:end]
00138       _x = self
00139       start = end
00140       end += 32
00141       (_x.slow_motor_current_limit, _x.quick_motor_current_limit, _x.duty_limit, _x.max_duty,) = _struct_4d.unpack(str[start:end])
00142       return self
00143     except struct.error as e:
00144       raise genpy.DeserializationError(e) #most likely buffer underfill
00145 
00146 _struct_I = genpy.struct_I
00147 _struct_4d = struct.Struct("<4d")


sr_edc_ethercat_drivers
Author(s): Yann Sionneau, Ugo Cupcic / ugo@shadowrobot.com, software@shadowrobot.com
autogenerated on Thu Jan 2 2014 12:03:32