_PR2GripperFindContactActionFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback.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 PR2GripperFindContactActionFeedback(genpy.Message):
00013   _md5sum = "6f5508091ee61f963690fb74fc7df932"
00014   _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback"
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 PR2GripperFindContactFeedback feedback
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/PR2GripperFindContactFeedback
00081 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00082 # feedback
00083 PR2GripperFindContactData data
00084 
00085 
00086 
00087 ================================================================================
00088 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactData
00089 # Time the data was recorded at
00090 time stamp
00091 
00092 # true when our contact conditions have been met
00093 # (see PR2GripperFindContact command)
00094 bool contact_conditions_met
00095 
00096 # the finger contact conditions 
00097 # true if the finger experienced a contact event
00098 #
00099 # contact events are defined as contact with the fingerpads
00100 # as either steady-state or high-freq force events
00101 bool left_fingertip_pad_contact
00102 bool right_fingertip_pad_contact
00103 
00104 # the force experinced by the finger Pads  (N)
00105 # NOTE:this ignores data from the edges of the finger pressure
00106 float64 left_fingertip_pad_force
00107 float64 right_fingertip_pad_force
00108 
00109 # the current joint position (m)
00110 float64 joint_position
00111 
00112 # the virtual (parallel) joint effort (N)
00113 float64 joint_effort
00114 
00115 # the control state of our realtime controller
00116 PR2GripperSensorRTState rtstate
00117 ================================================================================
00118 MSG: pr2_gripper_sensor_msgs/PR2GripperSensorRTState
00119 # the control state of our realtime controller
00120 int8 realtime_controller_state
00121 
00122 # predefined values to indicate our realtime_controller_state
00123 int8 DISABLED = 0
00124 int8 POSITION_SERVO = 3
00125 int8 FORCE_SERVO = 4
00126 int8 FIND_CONTACT = 5
00127 int8 SLIP_SERVO = 6
00128 """
00129   __slots__ = ['header','status','feedback']
00130   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback']
00131 
00132   def __init__(self, *args, **kwds):
00133     """
00134     Constructor. Any message fields that are implicitly/explicitly
00135     set to None will be assigned a default value. The recommend
00136     use is keyword arguments as this is more robust to future message
00137     changes.  You cannot mix in-order arguments and keyword arguments.
00138 
00139     The available fields are:
00140        header,status,feedback
00141 
00142     :param args: complete set of field values, in .msg order
00143     :param kwds: use keyword arguments corresponding to message field names
00144     to set specific fields.
00145     """
00146     if args or kwds:
00147       super(PR2GripperFindContactActionFeedback, self).__init__(*args, **kwds)
00148       #message fields cannot be None, assign default values for those that are
00149       if self.header is None:
00150         self.header = std_msgs.msg.Header()
00151       if self.status is None:
00152         self.status = actionlib_msgs.msg.GoalStatus()
00153       if self.feedback is None:
00154         self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactFeedback()
00155     else:
00156       self.header = std_msgs.msg.Header()
00157       self.status = actionlib_msgs.msg.GoalStatus()
00158       self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactFeedback()
00159 
00160   def _get_types(self):
00161     """
00162     internal API method
00163     """
00164     return self._slot_types
00165 
00166   def serialize(self, buff):
00167     """
00168     serialize message into buffer
00169     :param buff: buffer, ``StringIO``
00170     """
00171     try:
00172       _x = self
00173       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00174       _x = self.header.frame_id
00175       length = len(_x)
00176       if python3 or type(_x) == unicode:
00177         _x = _x.encode('utf-8')
00178         length = len(_x)
00179       buff.write(struct.pack('<I%ss'%length, length, _x))
00180       _x = self
00181       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00182       _x = self.status.goal_id.id
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188       buff.write(_struct_B.pack(self.status.status))
00189       _x = self.status.text
00190       length = len(_x)
00191       if python3 or type(_x) == unicode:
00192         _x = _x.encode('utf-8')
00193         length = len(_x)
00194       buff.write(struct.pack('<I%ss'%length, length, _x))
00195       _x = self
00196       buff.write(_struct_2I3B4db.pack(_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.contact_conditions_met, _x.feedback.data.left_fingertip_pad_contact, _x.feedback.data.right_fingertip_pad_contact, _x.feedback.data.left_fingertip_pad_force, _x.feedback.data.right_fingertip_pad_force, _x.feedback.data.joint_position, _x.feedback.data.joint_effort, _x.feedback.data.rtstate.realtime_controller_state))
00197     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00198     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00199 
00200   def deserialize(self, str):
00201     """
00202     unpack serialized message in str into this message instance
00203     :param str: byte array of serialized message, ``str``
00204     """
00205     try:
00206       if self.header is None:
00207         self.header = std_msgs.msg.Header()
00208       if self.status is None:
00209         self.status = actionlib_msgs.msg.GoalStatus()
00210       if self.feedback is None:
00211         self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactFeedback()
00212       end = 0
00213       _x = self
00214       start = end
00215       end += 12
00216       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00217       start = end
00218       end += 4
00219       (length,) = _struct_I.unpack(str[start:end])
00220       start = end
00221       end += length
00222       if python3:
00223         self.header.frame_id = str[start:end].decode('utf-8')
00224       else:
00225         self.header.frame_id = str[start:end]
00226       _x = self
00227       start = end
00228       end += 8
00229       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00230       start = end
00231       end += 4
00232       (length,) = _struct_I.unpack(str[start:end])
00233       start = end
00234       end += length
00235       if python3:
00236         self.status.goal_id.id = str[start:end].decode('utf-8')
00237       else:
00238         self.status.goal_id.id = str[start:end]
00239       start = end
00240       end += 1
00241       (self.status.status,) = _struct_B.unpack(str[start:end])
00242       start = end
00243       end += 4
00244       (length,) = _struct_I.unpack(str[start:end])
00245       start = end
00246       end += length
00247       if python3:
00248         self.status.text = str[start:end].decode('utf-8')
00249       else:
00250         self.status.text = str[start:end]
00251       _x = self
00252       start = end
00253       end += 44
00254       (_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.contact_conditions_met, _x.feedback.data.left_fingertip_pad_contact, _x.feedback.data.right_fingertip_pad_contact, _x.feedback.data.left_fingertip_pad_force, _x.feedback.data.right_fingertip_pad_force, _x.feedback.data.joint_position, _x.feedback.data.joint_effort, _x.feedback.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00255       self.feedback.data.contact_conditions_met = bool(self.feedback.data.contact_conditions_met)
00256       self.feedback.data.left_fingertip_pad_contact = bool(self.feedback.data.left_fingertip_pad_contact)
00257       self.feedback.data.right_fingertip_pad_contact = bool(self.feedback.data.right_fingertip_pad_contact)
00258       return self
00259     except struct.error as e:
00260       raise genpy.DeserializationError(e) #most likely buffer underfill
00261 
00262 
00263   def serialize_numpy(self, buff, numpy):
00264     """
00265     serialize message with numpy array types into buffer
00266     :param buff: buffer, ``StringIO``
00267     :param numpy: numpy python module
00268     """
00269     try:
00270       _x = self
00271       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00272       _x = self.header.frame_id
00273       length = len(_x)
00274       if python3 or type(_x) == unicode:
00275         _x = _x.encode('utf-8')
00276         length = len(_x)
00277       buff.write(struct.pack('<I%ss'%length, length, _x))
00278       _x = self
00279       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00280       _x = self.status.goal_id.id
00281       length = len(_x)
00282       if python3 or type(_x) == unicode:
00283         _x = _x.encode('utf-8')
00284         length = len(_x)
00285       buff.write(struct.pack('<I%ss'%length, length, _x))
00286       buff.write(_struct_B.pack(self.status.status))
00287       _x = self.status.text
00288       length = len(_x)
00289       if python3 or type(_x) == unicode:
00290         _x = _x.encode('utf-8')
00291         length = len(_x)
00292       buff.write(struct.pack('<I%ss'%length, length, _x))
00293       _x = self
00294       buff.write(_struct_2I3B4db.pack(_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.contact_conditions_met, _x.feedback.data.left_fingertip_pad_contact, _x.feedback.data.right_fingertip_pad_contact, _x.feedback.data.left_fingertip_pad_force, _x.feedback.data.right_fingertip_pad_force, _x.feedback.data.joint_position, _x.feedback.data.joint_effort, _x.feedback.data.rtstate.realtime_controller_state))
00295     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00296     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00297 
00298   def deserialize_numpy(self, str, numpy):
00299     """
00300     unpack serialized message in str into this message instance using numpy for array types
00301     :param str: byte array of serialized message, ``str``
00302     :param numpy: numpy python module
00303     """
00304     try:
00305       if self.header is None:
00306         self.header = std_msgs.msg.Header()
00307       if self.status is None:
00308         self.status = actionlib_msgs.msg.GoalStatus()
00309       if self.feedback is None:
00310         self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactFeedback()
00311       end = 0
00312       _x = self
00313       start = end
00314       end += 12
00315       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00316       start = end
00317       end += 4
00318       (length,) = _struct_I.unpack(str[start:end])
00319       start = end
00320       end += length
00321       if python3:
00322         self.header.frame_id = str[start:end].decode('utf-8')
00323       else:
00324         self.header.frame_id = str[start:end]
00325       _x = self
00326       start = end
00327       end += 8
00328       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00329       start = end
00330       end += 4
00331       (length,) = _struct_I.unpack(str[start:end])
00332       start = end
00333       end += length
00334       if python3:
00335         self.status.goal_id.id = str[start:end].decode('utf-8')
00336       else:
00337         self.status.goal_id.id = str[start:end]
00338       start = end
00339       end += 1
00340       (self.status.status,) = _struct_B.unpack(str[start:end])
00341       start = end
00342       end += 4
00343       (length,) = _struct_I.unpack(str[start:end])
00344       start = end
00345       end += length
00346       if python3:
00347         self.status.text = str[start:end].decode('utf-8')
00348       else:
00349         self.status.text = str[start:end]
00350       _x = self
00351       start = end
00352       end += 44
00353       (_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.contact_conditions_met, _x.feedback.data.left_fingertip_pad_contact, _x.feedback.data.right_fingertip_pad_contact, _x.feedback.data.left_fingertip_pad_force, _x.feedback.data.right_fingertip_pad_force, _x.feedback.data.joint_position, _x.feedback.data.joint_effort, _x.feedback.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00354       self.feedback.data.contact_conditions_met = bool(self.feedback.data.contact_conditions_met)
00355       self.feedback.data.left_fingertip_pad_contact = bool(self.feedback.data.left_fingertip_pad_contact)
00356       self.feedback.data.right_fingertip_pad_contact = bool(self.feedback.data.right_fingertip_pad_contact)
00357       return self
00358     except struct.error as e:
00359       raise genpy.DeserializationError(e) #most likely buffer underfill
00360 
00361 _struct_I = genpy.struct_I
00362 _struct_3I = struct.Struct("<3I")
00363 _struct_B = struct.Struct("<B")
00364 _struct_2I = struct.Struct("<2I")
00365 _struct_2I3B4db = struct.Struct("<2I3B4db")


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