Skip to content

Commit 0bc1de0

Browse files
committed
test: add tests for setTargetPayload call on urdriver
1 parent 5a79f9e commit 0bc1de0

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

tests/test_ur_driver.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,34 @@ TEST_F(UrDriverTest, set_tcp_offset)
374374
ASSERT_FALSE(g_my_robot->getUrDriver()->setTcpOffset(tcp_offset));
375375
}
376376

377+
TEST_F(UrDriverTest, set_target_payload_fallback_script)
378+
{
379+
g_my_robot->getUrDriver()->stopControl();
380+
ASSERT_TRUE(g_my_robot->waitForProgramNotRunning(1000));
381+
382+
std::this_thread::sleep_for(std::chrono::milliseconds(100));
383+
double mass = 1.0;
384+
vector3d_t cog = { 0.2, 0.3, 0.1 };
385+
vector6d_t inertia = { 0.4, 0.7, 0.8, 0.2, 0.5, 0.6 };
386+
double transition_time = 0.002;
387+
388+
bool result = g_my_robot->getUrDriver()->setTargetPayload(mass, cog, inertia, transition_time);
389+
390+
EXPECT_TRUE(result);
391+
}
392+
393+
TEST_F(UrDriverTest, set_target_payload)
394+
{
395+
double mass = 1.0;
396+
vector3d_t cog = { 0.2, 0.3, 0.1 };
397+
vector6d_t inertia = { 0.4, 0.7, 0.8, 0.2, 0.5, 0.6 };
398+
double transition_time = 0.002;
399+
400+
bool result = g_my_robot->getUrDriver()->setTargetPayload(mass, cog, inertia, transition_time);
401+
402+
EXPECT_TRUE(result);
403+
}
404+
377405
TEST(UrDriverInitTest, setting_connection_limits_works_correctly)
378406
{
379407
UrDriverConfiguration config;

0 commit comments

Comments
 (0)