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