Skip to content

Conversation

urfeex
Copy link
Member

@urfeex urfeex commented Oct 17, 2025

This adds the new Dashbaord Server called Robot API on PolyScope X 10.11.0 to the client library.

It is implemented as a drop-in replacement for the CB3 adn PolyScope 5 dashboard clients.

Note that this doesn't cover all features of the "old" Dashboard Server.

Add PolyScope X dashboard client aka Robot API to the client library.
@urfeex urfeex requested a review from a team October 17, 2025 10:11
@urfeex urfeex added the enhancement New feature or request label Oct 17, 2025
@urfeex urfeex force-pushed the polyscopex_dashboard_client branch from c661f42 to 5291e9b Compare October 17, 2025 10:14
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.89%. Comparing base (173e3c3) to head (426cff5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #392      +/-   ##
==========================================
+ Coverage   77.00%   82.89%   +5.89%     
==========================================
  Files          92        1      -91     
  Lines        4287      269    -4018     
  Branches      482        0     -482     
==========================================
- Hits         3301      223    -3078     
+ Misses        743       46     -697     
+ Partials      243        0     -243     
Flag Coverage Δ
start_ursim 82.89% <ø> (-1.30%) ⬇️
ur20-latest ?
ur5-3.14.3 ?
ur5e-10.7.0 ?
ur5e-5.9.4 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@urfeex urfeex force-pushed the polyscopex_dashboard_client branch from 5291e9b to dc018dc Compare October 17, 2025 10:18
@urfeex urfeex force-pushed the polyscopex_dashboard_client branch from 30f9749 to 0820448 Compare October 17, 2025 10:24

if (!my_dashboard->commandPowerOff())
// Bring the robot to a defined state being powered off. We're ignoring errors here since
// powering off an already powered off robot will return an error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment doesn't make sense as we return 1, if we fail to commandPowerOff, at least for generation 5.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I should update it. The comment actually only applies for PolyScope X

URCL_LOG_ERROR("Could not play program");
return 1;
// For PolyScope X, the command is called "resume"
if (!my_dashboard->commandResume())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work, isn't this command for when the program is paused?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The program should be paused at this stage.

* be made successfully.
*
*/
DashboardResponse commandPowerOnWithResponse(const std::chrono::duration<double> timeout = std::chrono::seconds(300));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

300 seconds seems like a lot

/*!
* \brief Send Power off command
*
* \return The response string returned by the server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it returning an object and not a string.

Should we consider removing return and throw in the description, as this is not included for all other of the commands with response, to make it consistent

bool commandIsInRemoteControl();

DashboardResponse commandIsInRemoteControlWithResponse();
/*!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move description above command

throw NotImplementedException("sendAndReceive is not implemented for DashboardClientImplX.");
}

bool DashboardClientImplX::connect(const size_t max_num_tries, const std::chrono::milliseconds reconnection_time)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a notice with a log a message to this function that it is not really available for PolyscopeX as there is nothing to connect to?

return false;
}

void DashboardClientImplX::disconnect()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for connect, some sort of notice?

bool DashboardClientImplX::sendRequest(const std::string& command_str, const std::string& expected_response_pattern,
const std::string& payload)
{
assertHasCommand(command_str);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this function not throwing not implemented error as the sendRequstString is?

EXPECT_TRUE(dashboard_client_->commandStop());
EXPECT_FALSE(dashboard_client_->commandRunning());
EXPECT_TRUE(dashboard_client_->commandPowerOff());
dashboard_client_->commandClosePopup(); // Necessary for CB3 test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed as everything is mocked.


EXPECT_TRUE(dashboard_client_->commandLoadProgram("wait_program.urp"));
EXPECT_TRUE(dashboard_client_->commandPowerOff());
dashboard_client_->commandClosePopup(); // Necessary for CB3 test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be needed as everything is mocked

Co-authored-by: Mads Holm Peters <79145214+urmahp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants