_PR2GripperFindContactActionResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import genpy
00008 import actionlib_msgs.msg
00009 import pr2_gripper_sensor_msgs.msg
00010 import std_msgs.msg
00011 
00012 class PR2GripperFindContactActionResult(genpy.Message):
00013   _md5sum = "a6c2a5d7fd0f224cb63dad13756a8a2a"
00014   _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult"
00015   _has_header = True #flag to mark the presence of a Header object
00016   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017 
00018 Header header
00019 actionlib_msgs/GoalStatus status
00020 PR2GripperFindContactResult result
00021 
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data 
00026 # in a particular coordinate frame.
00027 # 
00028 # sequence ID: consecutively increasing ID 
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039 
00040 ================================================================================
00041 MSG: actionlib_msgs/GoalStatus
00042 GoalID goal_id
00043 uint8 status
00044 uint8 PENDING         = 0   # The goal has yet to be processed by the action server
00045 uint8 ACTIVE          = 1   # The goal is currently being processed by the action server
00046 uint8 PREEMPTED       = 2   # The goal received a cancel request after it started executing
00047                             #   and has since completed its execution (Terminal State)
00048 uint8 SUCCEEDED       = 3   # The goal was achieved successfully by the action server (Terminal State)
00049 uint8 ABORTED         = 4   # The goal was aborted during execution by the action server due
00050                             #    to some failure (Terminal State)
00051 uint8 REJECTED        = 5   # The goal was rejected by the action server without being processed,
00052                             #    because the goal was unattainable or invalid (Terminal State)
00053 uint8 PREEMPTING      = 6   # The goal received a cancel request after it started executing
00054                             #    and has not yet completed execution
00055 uint8 RECALLING       = 7   # The goal received a cancel request before it started executing,
00056                             #    but the action server has not yet confirmed that the goal is canceled
00057 uint8 RECALLED        = 8   # The goal received a cancel request before it started executing
00058                             #    and was successfully cancelled (Terminal State)
00059 uint8 LOST            = 9   # An action client can determine that a goal is LOST. This should not be
00060                             #    sent over the wire by an action server
00061 
00062 #Allow for the user to associate a string with GoalStatus for debugging
00063 string text
00064 
00065 
00066 ================================================================================
00067 MSG: actionlib_msgs/GoalID
00068 # The stamp should store the time at which this goal was requested.
00069 # It is used by an action server when it tries to preempt all
00070 # goals that were requested before a certain time
00071 time stamp
00072 
00073 # The id provides a way to associate feedback and
00074 # result message with specific goal requests. The id
00075 # specified must be unique.
00076 string id
00077 
00078 
00079 ================================================================================
00080 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactResult
00081 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00082 #results
00083 PR2GripperFindContactData data
00084 
00085 ================================================================================
00086 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactData
00087 # Time the data was recorded at
00088 time stamp
00089 
00090 # true when our contact conditions have been met
00091 # (see PR2GripperFindContact command)
00092 bool contact_conditions_met
00093 
00094 # the finger contact conditions 
00095 # true if the finger experienced a contact event
00096 #
00097 # contact events are defined as contact with the fingerpads
00098 # as either steady-state or high-freq force events
00099 bool left_fingertip_pad_contact
00100 bool right_fingertip_pad_contact
00101 
00102 # the force experinced by the finger Pads  (N)
00103 # NOTE:this ignores data from the edges of the finger pressure
00104 float64 left_fingertip_pad_force
00105 float64 right_fingertip_pad_force
00106 
00107 # the current joint position (m)
00108 float64 joint_position
00109 
00110 # the virtual (parallel) joint effort (N)
00111 float64 joint_effort
00112 
00113 # the control state of our realtime controller
00114 PR2GripperSensorRTState rtstate
00115 ================================================================================
00116 MSG: pr2_gripper_sensor_msgs/PR2GripperSensorRTState
00117 # the control state of our realtime controller
00118 int8 realtime_controller_state
00119 
00120 # predefined values to indicate our realtime_controller_state
00121 int8 DISABLED = 0
00122 int8 POSITION_SERVO = 3
00123 int8 FORCE_SERVO = 4
00124 int8 FIND_CONTACT = 5
00125 int8 SLIP_SERVO = 6
00126 """
00127   __slots__ = ['header','status','result']
00128   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','pr2_gripper_sensor_msgs/PR2GripperFindContactResult']
00129 
00130   def __init__(self, *args, **kwds):
00131     """
00132     Constructor. Any message fields that are implicitly/explicitly
00133     set to None will be assigned a default value. The recommend
00134     use is keyword arguments as this is more robust to future message
00135     changes.  You cannot mix in-order arguments and keyword arguments.
00136 
00137     The available fields are:
00138        header,status,result
00139 
00140     :param args: complete set of field values, in .msg order
00141     :param kwds: use keyword arguments corresponding to message field names
00142     to set specific fields.
00143     """
00144     if args or kwds:
00145       super(PR2GripperFindContactActionResult, self).__init__(*args, **kwds)
00146       #message fields cannot be None, assign default values for those that are
00147       if self.header is None:
00148         self.header = std_msgs.msg.Header()
00149       if self.status is None:
00150         self.status = actionlib_msgs.msg.GoalStatus()
00151       if self.result is None:
00152         self.result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactResult()
00153     else:
00154       self.header = std_msgs.msg.Header()
00155       self.status = actionlib_msgs.msg.GoalStatus()
00156       self.result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactResult()
00157 
00158   def _get_types(self):
00159     """
00160     internal API method
00161     """
00162     return self._slot_types
00163 
00164   def serialize(self, buff):
00165     """
00166     serialize message into buffer
00167     :param buff: buffer, ``StringIO``
00168     """
00169     try:
00170       _x = self
00171       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00172       _x = self.header.frame_id
00173       length = len(_x)
00174       if python3 or type(_x) == unicode:
00175         _x = _x.encode('utf-8')
00176         length = len(_x)
00177       buff.write(struct.pack('<I%ss'%length, length, _x))
00178       _x = self
00179       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00180       _x = self.status.goal_id.id
00181       length = len(_x)
00182       if python3 or type(_x) == unicode:
00183         _x = _x.encode('utf-8')
00184         length = len(_x)
00185       buff.write(struct.pack('<I%ss'%length, length, _x))
00186       buff.write(_struct_B.pack(self.status.status))
00187       _x = self.status.text
00188       length = len(_x)
00189       if python3 or type(_x) == unicode:
00190         _x = _x.encode('utf-8')
00191         length = len(_x)
00192       buff.write(struct.pack('<I%ss'%length, length, _x))
00193       _x = self
00194       buff.write(_struct_2I3B4db.pack(_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.contact_conditions_met, _x.result.data.left_fingertip_pad_contact, _x.result.data.right_fingertip_pad_contact, _x.result.data.left_fingertip_pad_force, _x.result.data.right_fingertip_pad_force, _x.result.data.joint_position, _x.result.data.joint_effort, _x.result.data.rtstate.realtime_controller_state))
00195     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00196     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00197 
00198   def deserialize(self, str):
00199     """
00200     unpack serialized message in str into this message instance
00201     :param str: byte array of serialized message, ``str``
00202     """
00203     try:
00204       if self.header is None:
00205         self.header = std_msgs.msg.Header()
00206       if self.status is None:
00207         self.status = actionlib_msgs.msg.GoalStatus()
00208       if self.result is None:
00209         self.result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactResult()
00210       end = 0
00211       _x = self
00212       start = end
00213       end += 12
00214       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00215       start = end
00216       end += 4
00217       (length,) = _struct_I.unpack(str[start:end])
00218       start = end
00219       end += length
00220       if python3:
00221         self.header.frame_id = str[start:end].decode('utf-8')
00222       else:
00223         self.header.frame_id = str[start:end]
00224       _x = self
00225       start = end
00226       end += 8
00227       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00228       start = end
00229       end += 4
00230       (length,) = _struct_I.unpack(str[start:end])
00231       start = end
00232       end += length
00233       if python3:
00234         self.status.goal_id.id = str[start:end].decode('utf-8')
00235       else:
00236         self.status.goal_id.id = str[start:end]
00237       start = end
00238       end += 1
00239       (self.status.status,) = _struct_B.unpack(str[start:end])
00240       start = end
00241       end += 4
00242       (length,) = _struct_I.unpack(str[start:end])
00243       start = end
00244       end += length
00245       if python3:
00246         self.status.text = str[start:end].decode('utf-8')
00247       else:
00248         self.status.text = str[start:end]
00249       _x = self
00250       start = end
00251       end += 44
00252       (_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.contact_conditions_met, _x.result.data.left_fingertip_pad_contact, _x.result.data.right_fingertip_pad_contact, _x.result.data.left_fingertip_pad_force, _x.result.data.right_fingertip_pad_force, _x.result.data.joint_position, _x.result.data.joint_effort, _x.result.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00253       self.result.data.contact_conditions_met = bool(self.result.data.contact_conditions_met)
00254       self.result.data.left_fingertip_pad_contact = bool(self.result.data.left_fingertip_pad_contact)
00255       self.result.data.right_fingertip_pad_contact = bool(self.result.data.right_fingertip_pad_contact)
00256       return self
00257     except struct.error as e:
00258       raise genpy.DeserializationError(e) #most likely buffer underfill
00259 
00260 
00261   def serialize_numpy(self, buff, numpy):
00262     """
00263     serialize message with numpy array types into buffer
00264     :param buff: buffer, ``StringIO``
00265     :param numpy: numpy python module
00266     """
00267     try:
00268       _x = self
00269       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00270       _x = self.header.frame_id
00271       length = len(_x)
00272       if python3 or type(_x) == unicode:
00273         _x = _x.encode('utf-8')
00274         length = len(_x)
00275       buff.write(struct.pack('<I%ss'%length, length, _x))
00276       _x = self
00277       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00278       _x = self.status.goal_id.id
00279       length = len(_x)
00280       if python3 or type(_x) == unicode:
00281         _x = _x.encode('utf-8')
00282         length = len(_x)
00283       buff.write(struct.pack('<I%ss'%length, length, _x))
00284       buff.write(_struct_B.pack(self.status.status))
00285       _x = self.status.text
00286       length = len(_x)
00287       if python3 or type(_x) == unicode:
00288         _x = _x.encode('utf-8')
00289         length = len(_x)
00290       buff.write(struct.pack('<I%ss'%length, length, _x))
00291       _x = self
00292       buff.write(_struct_2I3B4db.pack(_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.contact_conditions_met, _x.result.data.left_fingertip_pad_contact, _x.result.data.right_fingertip_pad_contact, _x.result.data.left_fingertip_pad_force, _x.result.data.right_fingertip_pad_force, _x.result.data.joint_position, _x.result.data.joint_effort, _x.result.data.rtstate.realtime_controller_state))
00293     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00294     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00295 
00296   def deserialize_numpy(self, str, numpy):
00297     """
00298     unpack serialized message in str into this message instance using numpy for array types
00299     :param str: byte array of serialized message, ``str``
00300     :param numpy: numpy python module
00301     """
00302     try:
00303       if self.header is None:
00304         self.header = std_msgs.msg.Header()
00305       if self.status is None:
00306         self.status = actionlib_msgs.msg.GoalStatus()
00307       if self.result is None:
00308         self.result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactResult()
00309       end = 0
00310       _x = self
00311       start = end
00312       end += 12
00313       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00314       start = end
00315       end += 4
00316       (length,) = _struct_I.unpack(str[start:end])
00317       start = end
00318       end += length
00319       if python3:
00320         self.header.frame_id = str[start:end].decode('utf-8')
00321       else:
00322         self.header.frame_id = str[start:end]
00323       _x = self
00324       start = end
00325       end += 8
00326       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00327       start = end
00328       end += 4
00329       (length,) = _struct_I.unpack(str[start:end])
00330       start = end
00331       end += length
00332       if python3:
00333         self.status.goal_id.id = str[start:end].decode('utf-8')
00334       else:
00335         self.status.goal_id.id = str[start:end]
00336       start = end
00337       end += 1
00338       (self.status.status,) = _struct_B.unpack(str[start:end])
00339       start = end
00340       end += 4
00341       (length,) = _struct_I.unpack(str[start:end])
00342       start = end
00343       end += length
00344       if python3:
00345         self.status.text = str[start:end].decode('utf-8')
00346       else:
00347         self.status.text = str[start:end]
00348       _x = self
00349       start = end
00350       end += 44
00351       (_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.contact_conditions_met, _x.result.data.left_fingertip_pad_contact, _x.result.data.right_fingertip_pad_contact, _x.result.data.left_fingertip_pad_force, _x.result.data.right_fingertip_pad_force, _x.result.data.joint_position, _x.result.data.joint_effort, _x.result.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00352       self.result.data.contact_conditions_met = bool(self.result.data.contact_conditions_met)
00353       self.result.data.left_fingertip_pad_contact = bool(self.result.data.left_fingertip_pad_contact)
00354       self.result.data.right_fingertip_pad_contact = bool(self.result.data.right_fingertip_pad_contact)
00355       return self
00356     except struct.error as e:
00357       raise genpy.DeserializationError(e) #most likely buffer underfill
00358 
00359 _struct_I = genpy.struct_I
00360 _struct_3I = struct.Struct("<3I")
00361 _struct_B = struct.Struct("<B")
00362 _struct_2I = struct.Struct("<2I")
00363 _struct_2I3B4db = struct.Struct("<2I3B4db")


pr2_gripper_sensor_msgs
Author(s): Joe Romano
autogenerated on Mon Oct 6 2014 12:17:32