From 7c1ef8c3fd87ad23307782383d2dbfba79d5258c Mon Sep 17 00:00:00 2001 From: Mads Holm Peters Date: Mon, 17 Nov 2025 11:42:50 +0100 Subject: [PATCH] Initialize dashboard client for PolyScopeX version 10.11.0 and above There is dashboard client support for PolyScopeX version 10.11.0 and above, so we should initialize it in the ExampleRobotWrapper when it is possible. --- src/example_robot_wrapper.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/example_robot_wrapper.cpp b/src/example_robot_wrapper.cpp index 34353d201..d5ba33d98 100644 --- a/src/example_robot_wrapper.cpp +++ b/src/example_robot_wrapper.cpp @@ -46,9 +46,13 @@ ExampleRobotWrapper::ExampleRobotWrapper(const std::string& robot_ip, const std: primary_client_->start(); auto robot_version = primary_client_->getRobotVersion(); - if (*robot_version < VersionInformation::fromString("10.0.0")) + if (*robot_version < VersionInformation::fromString("10.0.0") || + *robot_version >= VersionInformation::fromString("10.11.0")) { - dashboard_client_ = std::make_shared(robot_ip); + const DashboardClient::ClientPolicy client_policy = *robot_version < VersionInformation::fromString("10.0.0") ? + DashboardClient::ClientPolicy::G5 : + DashboardClient::ClientPolicy::POLYSCOPE_X; + dashboard_client_ = std::make_shared(robot_ip, client_policy); // Connect the robot Dashboard if (!dashboard_client_->connect()) { @@ -107,8 +111,15 @@ bool ExampleRobotWrapper::clearProtectiveStop() URCL_LOG_INFO("Robot is in protective stop, trying to release it"); if (dashboard_client_ != nullptr) { - dashboard_client_->commandClosePopup(); - dashboard_client_->commandCloseSafetyPopup(); + try + { + dashboard_client_->commandClosePopup(); + dashboard_client_->commandCloseSafetyPopup(); + } + catch (const NotImplementedException&) + { + // The command is not yet implemented for the dashboardClient in PolyscopeX, so we just ignore the exception + } } try {