_ManualGraspingFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_assisted_grasping_msgs/ManualGraspingFeedback.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 ManualGraspingFeedback(genpy.Message):
00009   _md5sum = "f3ff485e50b6b796b59b216eafa15fd5"
00010   _type = "srs_assisted_grasping_msgs/ManualGraspingFeedback"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 # feedback
00014 #uint8 progress
00015 float32 tip1_force
00016 float32 tip2_force
00017 float32 tip3_force
00018 
00019 
00020 """
00021   __slots__ = ['tip1_force','tip2_force','tip3_force']
00022   _slot_types = ['float32','float32','float32']
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        tip1_force,tip2_force,tip3_force
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(ManualGraspingFeedback, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.tip1_force is None:
00042         self.tip1_force = 0.
00043       if self.tip2_force is None:
00044         self.tip2_force = 0.
00045       if self.tip3_force is None:
00046         self.tip3_force = 0.
00047     else:
00048       self.tip1_force = 0.
00049       self.tip2_force = 0.
00050       self.tip3_force = 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_3f.pack(_x.tip1_force, _x.tip2_force, _x.tip3_force))
00066     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00067     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00068 
00069   def deserialize(self, str):
00070     """
00071     unpack serialized message in str into this message instance
00072     :param str: byte array of serialized message, ``str``
00073     """
00074     try:
00075       end = 0
00076       _x = self
00077       start = end
00078       end += 12
00079       (_x.tip1_force, _x.tip2_force, _x.tip3_force,) = _struct_3f.unpack(str[start:end])
00080       return self
00081     except struct.error as e:
00082       raise genpy.DeserializationError(e) #most likely buffer underfill
00083 
00084 
00085   def serialize_numpy(self, buff, numpy):
00086     """
00087     serialize message with numpy array types into buffer
00088     :param buff: buffer, ``StringIO``
00089     :param numpy: numpy python module
00090     """
00091     try:
00092       _x = self
00093       buff.write(_struct_3f.pack(_x.tip1_force, _x.tip2_force, _x.tip3_force))
00094     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00095     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00096 
00097   def deserialize_numpy(self, str, numpy):
00098     """
00099     unpack serialized message in str into this message instance using numpy for array types
00100     :param str: byte array of serialized message, ``str``
00101     :param numpy: numpy python module
00102     """
00103     try:
00104       end = 0
00105       _x = self
00106       start = end
00107       end += 12
00108       (_x.tip1_force, _x.tip2_force, _x.tip3_force,) = _struct_3f.unpack(str[start:end])
00109       return self
00110     except struct.error as e:
00111       raise genpy.DeserializationError(e) #most likely buffer underfill
00112 
00113 _struct_I = genpy.struct_I
00114 _struct_3f = struct.Struct("<3f")


srs_assisted_grasping_msgs
Author(s): Zdenek Materna
autogenerated on Mon Oct 6 2014 07:57:12