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