Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/ur/dashboard_client_implementation_g5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ DashboardResponse DashboardClientImplG5::commandPowerOn(const std::chrono::durat
DashboardResponse response;
try
{
response.message = retryCommandString("power on", "Powering on", "robotmode", "Robotmode: IDLE", timeout);
response.message = retryCommandString("power on", "Powering on", "robotmode", "Robotmode: (IDLE|RUNNING)", timeout);
response.ok = true;
}
catch (const UnexpectedResponse& e)
Expand Down
37 changes: 37 additions & 0 deletions tests/test_dashboard_client_g5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,43 @@ TEST_F(DashboardClientTestG5, connect)
ASSERT_TRUE(response.ok);
}

TEST_F(DashboardClientTestG5, power_cycle)
{
EXPECT_TRUE(dashboard_client_->connect());
DashboardResponse response;

// Cycle from POWER_OFF to IDLE to RUNNING
response = dashboard_client_->commandPowerOff();
EXPECT_TRUE(response.ok);
response = dashboard_client_->commandPowerOn(std::chrono::seconds(5));
EXPECT_TRUE(response.ok);
response = dashboard_client_->commandBrakeRelease();
EXPECT_TRUE(response.ok);

// Calling power_on on a brake-released robot should succeed
response = dashboard_client_->commandPowerOn(std::chrono::seconds(5));
EXPECT_TRUE(response.ok);

// Power off from brake-released state (RUNNING)
response = dashboard_client_->commandPowerOff();
EXPECT_TRUE(response.ok);

// Power off from powered_on state (IDLE)
dashboard_client_->commandPowerOn();
response = dashboard_client_->commandPowerOff();
EXPECT_TRUE(response.ok);

// Power off from powered_on state (IDLE)
dashboard_client_->commandPowerOff();
response = dashboard_client_->commandPowerOff();
EXPECT_TRUE(response.ok);

// Brake release from POWER_OFF should succeed
dashboard_client_->commandPowerOff();
response = dashboard_client_->commandBrakeRelease();
EXPECT_TRUE(response.ok);
}

TEST_F(DashboardClientTestG5, run_program)
{
EXPECT_TRUE(dashboard_client_->connect());
Expand Down
Loading