_ManualGraspingGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_assisted_grasping_msgs/ManualGraspingGoal.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 ManualGraspingGoal(genpy.Message):
00009   _md5sum = "9ab9620ff244d7283f96379a16476d1e"
00010   _type = "srs_assisted_grasping_msgs/ManualGraspingGoal"
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 # goal
00014 uint8 grasp_type
00015 float32 max_force
00016 bool accept_two_fingers_contact
00017 bool do_not_open_fingers
00018 
00019 """
00020   __slots__ = ['grasp_type','max_force','accept_two_fingers_contact','do_not_open_fingers']
00021   _slot_types = ['uint8','float32','bool','bool']
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        grasp_type,max_force,accept_two_fingers_contact,do_not_open_fingers
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(ManualGraspingGoal, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.grasp_type is None:
00041         self.grasp_type = 0
00042       if self.max_force is None:
00043         self.max_force = 0.
00044       if self.accept_two_fingers_contact is None:
00045         self.accept_two_fingers_contact = False
00046       if self.do_not_open_fingers is None:
00047         self.do_not_open_fingers = False
00048     else:
00049       self.grasp_type = 0
00050       self.max_force = 0.
00051       self.accept_two_fingers_contact = False
00052       self.do_not_open_fingers = False
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_Bf2B.pack(_x.grasp_type, _x.max_force, _x.accept_two_fingers_contact, _x.do_not_open_fingers))
00068     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00069     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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 += 7
00081       (_x.grasp_type, _x.max_force, _x.accept_two_fingers_contact, _x.do_not_open_fingers,) = _struct_Bf2B.unpack(str[start:end])
00082       self.accept_two_fingers_contact = bool(self.accept_two_fingers_contact)
00083       self.do_not_open_fingers = bool(self.do_not_open_fingers)
00084       return self
00085     except struct.error as e:
00086       raise genpy.DeserializationError(e) #most likely buffer underfill
00087 
00088 
00089   def serialize_numpy(self, buff, numpy):
00090     """
00091     serialize message with numpy array types into buffer
00092     :param buff: buffer, ``StringIO``
00093     :param numpy: numpy python module
00094     """
00095     try:
00096       _x = self
00097       buff.write(_struct_Bf2B.pack(_x.grasp_type, _x.max_force, _x.accept_two_fingers_contact, _x.do_not_open_fingers))
00098     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00099     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00100 
00101   def deserialize_numpy(self, str, numpy):
00102     """
00103     unpack serialized message in str into this message instance using numpy for array types
00104     :param str: byte array of serialized message, ``str``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       end = 0
00109       _x = self
00110       start = end
00111       end += 7
00112       (_x.grasp_type, _x.max_force, _x.accept_two_fingers_contact, _x.do_not_open_fingers,) = _struct_Bf2B.unpack(str[start:end])
00113       self.accept_two_fingers_contact = bool(self.accept_two_fingers_contact)
00114       self.do_not_open_fingers = bool(self.do_not_open_fingers)
00115       return self
00116     except struct.error as e:
00117       raise genpy.DeserializationError(e) #most likely buffer underfill
00118 
00119 _struct_I = genpy.struct_I
00120 _struct_Bf2B = struct.Struct("<Bf2B")


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