Skip to content

Commit

Permalink
Implement test of tool contact
Browse files Browse the repository at this point in the history
  • Loading branch information
URJala committed Jul 10, 2024
1 parent d931274 commit d825856
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ur_robot_driver/test/robot_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ def test_trajectory_scaled(self, tf_prefix):
)
self.assertEqual(result.error_code, FollowJointTrajectory.Result.SUCCESSFUL)

def test_tool_contact(self, tf_prefix):
start_result = self._io_status_controller_interface.start_tool_contact()
self.assertEqual(start_result.success, True)

end_result = self._io_status_controller_interface.end_tool_contact()
self.assertEqual(end_result.success, True)

def test_trajectory_scaled_aborts_on_violation(self, tf_prefix):
"""Test that the robot correctly aborts the trajectory when the constraints are violated."""
# Construct test trajectory
Expand Down
6 changes: 5 additions & 1 deletion ur_robot_driver/test/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ class IoStatusInterface(
_ServiceInterface,
namespace="/io_and_status_controller",
initial_services={"set_io": SetIO},
services={"resend_robot_program": Trigger},
services={
"resend_robot_program": Trigger,
"start_tool_contact": Trigger,
"end_tool_contact": Trigger,
},
):
pass

Expand Down

0 comments on commit d825856

Please sign in to comment.