File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff 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
384407int main (int argc, char * argv[])
You can’t perform that action at this time.
0 commit comments