Skip to content

Commit 8eeb698

Browse files
Added integration test
1 parent 7972668 commit 8eeb698

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_ur_driver.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,29 @@ TEST_F(UrDriverTest, reset_rtde_client)
379379
ASSERT_EQ(g_ur_driver_->getControlFrequency(), target_frequency);
380380
}
381381

382+
TEST_F(UrDriverTest, read_error_code)
383+
{
384+
g_ur_driver_->startErrorCodeClientCommunication();
385+
std::stringstream cmd;
386+
cmd << "sec setup():" << std::endl << " protective_stop()" << std::endl << "end";
387+
EXPECT_TRUE(g_ur_driver_->sendScript(cmd.str()));
388+
389+
auto error_codes = g_ur_driver_->getErrorCodes();
390+
while (error_codes.size() == 0) {
391+
error_codes = g_ur_driver_->getErrorCodes();
392+
}
393+
394+
ASSERT_EQ(error_codes.size(), 1);
395+
ASSERT_EQ(error_codes.at(0).message_code, 209);
396+
ASSERT_EQ(error_codes.at(0).message_argument, 0);
397+
398+
// Wait for PSTOP to show up on TP so we can clear it
399+
std::this_thread::sleep_for(std::chrono::milliseconds(200));
400+
401+
EXPECT_TRUE(g_dashboard_client_->commandCloseSafetyPopup());
402+
EXPECT_TRUE(g_dashboard_client_->commandUnlockProtectiveStop());
403+
}
404+
382405
// TODO we should add more tests for the UrDriver class.
383406

384407
int main(int argc, char* argv[])

0 commit comments

Comments
 (0)