3939from rclpy .node import Node
4040
4141from controller_manager_msgs .srv import SwitchController
42- from ur_msgs .action import TrajectoryUntil
42+ from ur_msgs .action import FollowJointTrajectoryUntil
4343from action_msgs .srv import CancelGoal_Response
4444from trajectory_msgs .msg import JointTrajectory , JointTrajectoryPoint
4545from 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