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