@@ -105,11 +105,14 @@ def setUp(self):
105105 # Tests
106106 #
107107
108- def test_trajectory_with_tool_contact_no_trigger_succeeds (self , tf_prefix ):
108+ def test_trajectory_with_tool_contact_no_trigger_succeeds (
109+ self , tf_prefix , initial_joint_controller
110+ ):
111+ self ._controller_manager_interface .wait_for_controller (initial_joint_controller )
109112 self .assertTrue (
110113 self ._controller_manager_interface .switch_controller (
111114 strictness = SwitchController .Request .BEST_EFFORT ,
112- activate_controllers = ["tool_contact_controller" ],
115+ activate_controllers = ["tool_contact_controller" , initial_joint_controller ],
113116 ).ok
114117 )
115118 trajectory = JointTrajectory ()
@@ -133,18 +136,13 @@ def test_trajectory_with_tool_contact_no_trigger_succeeds(self, tf_prefix):
133136 self .assertEqual (
134137 result .until_condition_result , FollowJointTrajectoryUntil .Result .NOT_TRIGGERED
135138 )
136- self .assertTrue (
137- self ._controller_manager_interface .switch_controller (
138- strictness = SwitchController .Request .BEST_EFFORT ,
139- deactivate_controllers = ["tool_contact_controller" ],
140- ).ok
141- )
142139
143- def test_trajectory_until_can_cancel (self , tf_prefix ):
140+ def test_trajectory_until_can_cancel (self , tf_prefix , initial_joint_controller ):
141+ self ._controller_manager_interface .wait_for_controller (initial_joint_controller )
144142 self .assertTrue (
145143 self ._controller_manager_interface .switch_controller (
146144 strictness = SwitchController .Request .BEST_EFFORT ,
147- activate_controllers = ["tool_contact_controller" ],
145+ activate_controllers = ["tool_contact_controller" , initial_joint_controller ],
148146 ).ok
149147 )
150148 trajectory = JointTrajectory ()
@@ -162,9 +160,3 @@ def test_trajectory_until_can_cancel(self, tf_prefix):
162160 self .assertTrue (goal_handle .accepted )
163161 result = self ._trajectory_until_interface .cancel_goal (goal_handle )
164162 self .assertEqual (result .return_code , CancelGoal .ERROR_NONE )
165- self .assertTrue (
166- self ._controller_manager_interface .switch_controller (
167- strictness = SwitchController .Request .BEST_EFFORT ,
168- deactivate_controllers = ["tool_contact_controller" ],
169- ).ok
170- )
0 commit comments