Skip to content

Commit

Permalink
Add a test for the gripper's gripper_control action
Browse files Browse the repository at this point in the history
Also add meaningful values for `max_grip_force`, `min_grip_force`,
`max_vel`, and `min_vel` (EGK 40).
  • Loading branch information
stefanscherzinger committed Aug 26, 2024
1 parent 2355856 commit 75f42ff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
8 changes: 4 additions & 4 deletions schunk_egu_egk_gripper_dummy/config/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@
"00000000"
],
"0x0628": [
"40B00000"
"0000B040"
],
"0x0630": [
"42E60000"
"0000E642"
],
"0x0650": [
"41B00000"
],
"0x0658": [
"42960000"
"00009642"
],
"0x0660": [
"43160000"
"0000B442"
],
"0x06A8": [
"00000000"
Expand Down
20 changes: 20 additions & 0 deletions schunk_egu_egk_gripper_tests/test/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
MoveToRelativePosition,
ReleaseWorkpiece,
)
from control_msgs.action import GripperCommand


@pytest.mark.launch(fixture=launch_description)
Expand Down Expand Up @@ -57,6 +58,25 @@ def test_driver_grips_with_position(running_driver):
assert action.result.workpiece_lost is False


@pytest.mark.launch(fixture=launch_description)
def test_driver_supports_gripper_control(running_driver):

runs = [
{"position": 0.0, "max_effort": 77.0}, # grip workpiece
{"position": 82.4, "max_effort": 0.0}, # move to abs. position
{"position": 66.3, "max_effort": 85.1}, # grip with position
]

for run in runs:
goal = GripperCommand.Goal()
goal.command.position = run["position"]
goal.command.max_effort = run["max_effort"]
action = ActionReturnsResult("/gripper_control", GripperCommand, goal)
action.event.wait()
assert action.result.reached_goal
assert action.result.stalled


@pytest.mark.launch(fixture=launch_description)
def test_driver_moves_to_absolute_position(running_driver):
test_positions = [43.55, 17.02, 38.55, 103.7]
Expand Down

0 comments on commit 75f42ff

Please sign in to comment.