@@ -44,6 +44,7 @@ const std::string CALIBRATION_CHECKSUM = "calib_12788084448423163542";
4444std::string ROBOT_IP = " 192.168.56.101" ;
4545
4646bool g_program_running;
47+ bool g_is_protective_stopped = false ;
4748std::condition_variable g_program_not_running_cv;
4849std::mutex g_program_not_running_mutex;
4950std::condition_variable g_program_running_cv;
@@ -135,13 +136,17 @@ class InstructionExecutorTest : public ::testing::Test
135136 void SetUp () override
136137 {
137138 executor_ = std::make_unique<InstructionExecutor>(g_ur_driver);
138- // Make sure script is running on the robot
139- if (g_program_running == false )
139+ if (g_is_protective_stopped)
140140 {
141+ // We forced a protective stop above. Some versions require waiting 5 seconds before releasing
142+ // the protective stop.
143+ std::this_thread::sleep_for (std::chrono::seconds (5 ));
141144 g_dashboard_client->commandCloseSafetyPopup ();
142- std::this_thread::sleep_for (std::chrono::milliseconds (500 ));
143145 ASSERT_TRUE (g_dashboard_client->commandUnlockProtectiveStop ());
144-
146+ }
147+ // Make sure script is running on the robot
148+ if (g_program_running == false )
149+ {
145150 g_ur_driver->sendRobotProgram ();
146151 ASSERT_TRUE (waitForProgramRunning (1000 ));
147152 }
@@ -293,6 +298,7 @@ TEST_F(InstructionExecutorTest, unfeasible_movej_target_results_in_failure)
293298
294299 // move to an unfeasible pose
295300 ASSERT_FALSE (executor_->moveJ ({ -123 , 0 , 0 , 0 , 0 , 0 }));
301+ g_is_protective_stopped = true ;
296302}
297303
298304TEST_F (InstructionExecutorTest, unfeasible_movel_target_results_in_failure)
@@ -302,6 +308,7 @@ TEST_F(InstructionExecutorTest, unfeasible_movel_target_results_in_failure)
302308
303309 // move to an unfeasible pose
304310 ASSERT_FALSE (executor_->moveL ({ -10.203 , 0.263 , 0.559 , 0.68 , -1.083 , -2.076 }, 1.4 , 1.04 , 0.1 ));
311+ g_is_protective_stopped = true ;
305312}
306313
307314TEST_F (InstructionExecutorTest, unfeasible_sequence_targets_results_in_failure)
@@ -312,6 +319,7 @@ TEST_F(InstructionExecutorTest, unfeasible_sequence_targets_results_in_failure)
312319
313320 };
314321 ASSERT_FALSE (executor_->executeMotion (motion_sequence));
322+ g_is_protective_stopped = true ;
315323}
316324
317325TEST_F (InstructionExecutorTest, unfeasible_times_succeeds)
0 commit comments