Skip to content

Commit a46e598

Browse files
committed
Do not run dashboard example on PolyScopeX
1 parent 5c90cdb commit a46e598

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

examples/dashboard_example.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@
3333
#include <ur_client_library/log.h>
3434
#include <ur_client_library/ur/dashboard_client.h>
3535

36+
#include <iostream>
3637
#include <memory>
38+
#include <sstream>
3739
#include <thread>
40+
#include "ur_client_library/comm/pipeline.h"
41+
#include "ur_client_library/primary/primary_client.h"
3842

3943
using namespace urcl;
4044

@@ -55,6 +59,18 @@ int main(int argc, char* argv[])
5559
robot_ip = std::string(argv[1]);
5660
}
5761

62+
urcl::comm::INotifier notifier;
63+
urcl::primary_interface::PrimaryClient primary_client(robot_ip, notifier);
64+
primary_client.start();
65+
auto version_information = primary_client.getRobotVersion();
66+
if (version_information->major >= 10)
67+
{
68+
std::stringstream ss;
69+
ss << "Robot has version " << *version_information << ". This example is not compatible with PolyScope X";
70+
URCL_LOG_ERROR(ss.str().c_str());
71+
return 0;
72+
}
73+
5874
// Connect to the robot Dashboard Server
5975
auto my_dashboard = std::make_unique<DashboardClient>(robot_ip);
6076
if (!my_dashboard->connect())

0 commit comments

Comments
 (0)