Skip to content

Commit

Permalink
Increased wait before clearing PStop
Browse files Browse the repository at this point in the history
  • Loading branch information
jessica-chen-ocado committed Jan 13, 2025
1 parent 9751bdd commit 8ba4d1b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_ur_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,18 +385,19 @@ TEST_F(UrDriverTest, read_error_code)
std::stringstream cmd;
cmd << "sec setup():" << std::endl << " protective_stop()" << std::endl << "end";
EXPECT_TRUE(g_ur_driver_->sendScript(cmd.str()));

auto error_codes = g_ur_driver_->getErrorCodes();
while (error_codes.size() == 0) {
while (error_codes.size() == 0)
{
error_codes = g_ur_driver_->getErrorCodes();
}

ASSERT_EQ(error_codes.size(), 1);
ASSERT_EQ(error_codes.at(0).message_code, 209);
ASSERT_EQ(error_codes.at(0).message_argument, 0);

// Wait for PSTOP to show up on TP so we can clear it
std::this_thread::sleep_for(std::chrono::milliseconds(200));
// Wait for 5s after PSTOP before clearing it
std::this_thread::sleep_for(std::chrono::seconds(5));

EXPECT_TRUE(g_dashboard_client_->commandCloseSafetyPopup());
EXPECT_TRUE(g_dashboard_client_->commandUnlockProtectiveStop());
Expand Down

0 comments on commit 8ba4d1b

Please sign in to comment.