Skip to content

Commit

Permalink
Add arm.gripper_position_detector.min_position to compare
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoDCC committed Oct 11, 2022
1 parent f31614e commit 1497e83
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@


class GripperPositionDetector(RobotPart):
def __init__(self, robot_name: str, tf_buffer: str, joint_topic: str) -> None:
def __init__(self, robot_name: str, tf_buffer: str, joint_topic: str, min_position: float) -> None:
"""
Class for getting the position of the hand motor joint (how much the gripper is open or closed)
Values go from 1 (open) to -1 (closed)
:param robot_name: Name of the robot
:param tf_buffer: tf2_ros.Buffer for use in RobotPart
:param joint_topic: Topic to use for measurement
:param min_position: Range value from -1.0 (gripper fully opened) to 1.0 (closed fully closed)
"""

super(GripperPositionDetector, self).__init__(robot_name=robot_name, tf_buffer=tf_buffer)
Expand All @@ -24,6 +25,7 @@ def __init__(self, robot_name: str, tf_buffer: str, joint_topic: str) -> None:
self.current_position = None
self.store_position = False # Flag to store the position
self.start_time = None
self.min_position = min_position

def _joint_callback(self, msg: JointState) -> None:
"""
Expand Down

0 comments on commit 1497e83

Please sign in to comment.