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


pr2_object_manipulation_msgs
Author(s): Matei Ciocarlie
autogenerated on Mon Oct 6 2014 11:55:20