Skip to content

Commit df1a32c

Browse files
committed
update test to unspawn the controllers and recheck the release of interfaces
1 parent 00be2ae commit df1a32c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

controller_manager/test/test_release_interfaces.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,30 @@ TEST_F(TestControllerInterfacesRemapping, check_resource_manager_resources)
315315
ASSERT_TRUE(cm_->resource_manager_->command_interface_is_claimed(itf))
316316
<< "The command interface is supposed to be claimed by the controller : " << itf;
317317
}
318+
319+
EXPECT_EQ(
320+
std::system(
321+
std::string(
322+
"ros2 run controller_manager unspawner controller_joint1 -c test_controller_manager")
323+
.c_str()),
324+
0);
325+
ASSERT_FALSE(cm_->resource_manager_->command_interface_is_claimed("joint1/effort"));
326+
327+
// Now unspawn the controller_joint2 and controller_joint3 and see if the respective interfaces
328+
// are released
329+
EXPECT_EQ(
330+
std::system(
331+
std::string(
332+
"ros2 run controller_manager unspawner controller_joint2 -c test_controller_manager")
333+
.c_str()),
334+
0);
335+
ASSERT_FALSE(cm_->resource_manager_->command_interface_is_claimed("joint2/torque"));
336+
337+
EXPECT_EQ(
338+
std::system(
339+
std::string(
340+
"ros2 run controller_manager unspawner controller_joint3 -c test_controller_manager")
341+
.c_str()),
342+
0);
343+
ASSERT_FALSE(cm_->resource_manager_->command_interface_is_claimed("joint3/force"));
318344
}

0 commit comments

Comments
 (0)