Skip to content

Commit 50212c2

Browse files
authored
Fix data field for loaded program RobotAPI call (#443)
When implementing the RobotAPI 3.1.4 the get_loaded_program call did not implement the data field correctly matching the [documentation](https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/542731ab3bd4d0e06ab7b91fc733ec36cb5af150/include/ur_client_library/ur/dashboard_client.h#L517) and the [G5 implementation](https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/542731ab3bd4d0e06ab7b91fc733ec36cb5af150/src/ur/dashboard_client_implementation_g5.cpp#L937). This commit fixes that.
1 parent 542731a commit 50212c2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/ur/dashboard_client_implementation_x.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ DashboardResponse DashboardClientImplX::commandGetLoadedProgram()
304304
auto json_data = json::parse(response.message);
305305
if (response.ok)
306306
{
307-
response.data["loaded_program"] = std::string(json_data["name"]);
307+
response.data["program_name"] = std::string(json_data["name"]);
308308
}
309309
return response;
310310
}

tests/test_dashboard_client_x.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ TEST_F(DashboardClientTestX, get_loaded_program)
119119
{
120120
auto response = dashboard_client_->commandGetLoadedProgram();
121121
ASSERT_TRUE(response.ok);
122-
ASSERT_EQ(std::get<std::string>(response.data["loaded_program"]), "Default program");
122+
ASSERT_EQ(std::get<std::string>(response.data["program_name"]), "Default program");
123123
}
124124
}
125125

@@ -200,7 +200,7 @@ TEST_F(DashboardClientTestX, program_interaction)
200200
if (dashboard_client_->getRobotApiVersion() >= VersionInformation::fromString("3.1.4"))
201201
{
202202
response = dashboard_client_->commandGetLoadedProgram();
203-
ASSERT_EQ(std::get<std::string>(response.data["loaded_program"]), "wait_program");
203+
ASSERT_EQ(std::get<std::string>(response.data["program_name"]), "wait_program");
204204
}
205205
response = dashboard_client_->commandPowerOn();
206206
ASSERT_TRUE(response.ok);

0 commit comments

Comments
 (0)