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