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


netft_example_controllers
Author(s): DerekKing
autogenerated on Fri Jan 3 2014 11:34:49