Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions tests/test_ur_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ class UrDriverTest : public ::testing::Test

void SetUp()
{
ASSERT_TRUE(g_my_robot->isHealthy());
if (!g_my_robot->isHealthy())
{
ASSERT_TRUE(g_my_robot->resendRobotProgram());
ASSERT_TRUE(g_my_robot->waitForProgramRunning(500));
}
}

void TearDown()
{
g_my_robot->ur_driver_->stopControl();
g_my_robot->waitForProgramNotRunning(1000);
}
};

Expand Down Expand Up @@ -224,13 +234,16 @@ TEST_F(UrDriverTest, send_robot_program_retry_on_failure)
{
// Check that sendRobotProgram is robust to the secondary stream being disconnected. This is what happens when
// switching from Remote to Local and back to Remote mode for example.
g_my_robot->ur_driver_->secondary_stream_->close();

std::this_thread::sleep_for(std::chrono::milliseconds(100));
// To be able to re-send the robot program we'll have to make sure it isn't running
g_my_robot->ur_driver_->stopControl();
g_my_robot->waitForProgramNotRunning();

g_my_robot->ur_driver_->secondary_stream_->close();

EXPECT_TRUE(g_my_robot->resendRobotProgram());

EXPECT_TRUE(g_my_robot->waitForProgramRunning());
EXPECT_TRUE(g_my_robot->waitForProgramRunning(1000));
}

TEST_F(UrDriverTest, reset_rtde_client)
Expand Down
Loading