Skip to content

Commit 6cb3d58

Browse files
committed
Fixed and added move_until integration test
1 parent 461fe06 commit 6cb3d58

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

ur_robot_driver/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,5 +278,9 @@ if(BUILD_TESTING)
278278
TIMEOUT
279279
800
280280
)
281+
add_launch_test(test/integration_test_trajectory_until.py
282+
TIMEOUT
283+
800
284+
)
281285
endif()
282286
endif()

ur_robot_driver/test/integration_test_trajectory_until.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from rclpy.node import Node
4040

4141
from controller_manager_msgs.srv import SwitchController
42-
from ur_msgs.action import TrajectoryUntil
42+
from ur_msgs.action import FollowJointTrajectoryUntil
4343
from action_msgs.srv import CancelGoal_Response
4444
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
4545
from builtin_interfaces.msg import Duration
@@ -87,7 +87,7 @@ def init_robot(self):
8787
self._controller_manager_interface = ControllerManagerInterface(self.node)
8888
self._io_status_controller_interface = IoStatusInterface(self.node)
8989
self._trajectory_until_interface = ActionInterface(
90-
self.node, "/trajectory_until_node/execute", TrajectoryUntil
90+
self.node, "/trajectory_until_node/execute", FollowJointTrajectoryUntil
9191
)
9292
self.test_traj = {
9393
"waypts": [[1.5, -1.5, 0.0, -1.5, -1.5, -1.5], [2.1, -1.2, 0.0, -2.4, -1.5, -1.5]],
@@ -120,15 +120,17 @@ def test_trajectory_with_tool_contact_no_trigger_succeeds(self, tf_prefix):
120120
for i in range(len(self.test_traj["waypts"]))
121121
]
122122
goal_handle = self._trajectory_until_interface.send_goal(
123-
trajectory=trajectory, until_type=TrajectoryUntil.Goal.TOOL_CONTACT
123+
trajectory=trajectory, until_type=FollowJointTrajectoryUntil.Goal.TOOL_CONTACT
124124
)
125125
self.assertTrue(goal_handle.accepted)
126126
if goal_handle.accepted:
127127
result = self._trajectory_until_interface.get_result(
128128
goal_handle, TIMEOUT_EXECUTE_TRAJECTORY
129129
)
130-
self.assertEqual(result.error_code, TrajectoryUntil.Result.SUCCESSFUL)
131-
self.assertEqual(result.until_condition_result, TrajectoryUntil.Result.NOT_TRIGGERED)
130+
self.assertEqual(result.error_code, FollowJointTrajectoryUntil.Result.SUCCESSFUL)
131+
self.assertEqual(
132+
result.until_condition_result, FollowJointTrajectoryUntil.Result.NOT_TRIGGERED
133+
)
132134
self.assertTrue(
133135
self._controller_manager_interface.switch_controller(
134136
strictness=SwitchController.Request.BEST_EFFORT,
@@ -153,12 +155,10 @@ def test_trajectory_until_can_cancel(self, tf_prefix):
153155
for i in range(len(self.test_traj["waypts"]))
154156
]
155157
goal_handle = self._trajectory_until_interface.send_goal(
156-
trajectory=trajectory, until_type=TrajectoryUntil.Goal.TOOL_CONTACT
158+
trajectory=trajectory, until_type=FollowJointTrajectoryUntil.Goal.TOOL_CONTACT
157159
)
158160
self.assertTrue(goal_handle.accepted)
159-
time.sleep(2)
160161
result = self._trajectory_until_interface.cancel_goal(goal_handle)
161-
time.sleep(2)
162162
self.assertEqual(result.return_code, CancelGoal_Response.ERROR_NONE)
163163
self.assertTrue(
164164
self._controller_manager_interface.switch_controller(

0 commit comments

Comments
 (0)