File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
diff_drive_controller/test
omni_wheel_drive_controller/test Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,15 @@ class TestDiffDriveController : public ::testing::Test
101101 controller_name + " /cmd_vel" , rclcpp::SystemDefaultsQoS ());
102102 }
103103
104+ void TearDown () override
105+ {
106+ // Reset the controller before the fixture is destroyed to ensure the controller's
107+ // shutdown transition (which clears loaned interfaces) runs while the underlying
108+ // StateInterface/CommandInterface objects are still alive. LoanedStateInterface stores
109+ // a const reference (not a shared_ptr), so destruction order matters.
110+ controller_.reset ();
111+ }
112+
104113 static void TearDownTestCase () { rclcpp::shutdown (); }
105114
106115 // / Publish velocity msgs
Original file line number Diff line number Diff line change @@ -99,6 +99,15 @@ class OmniWheelDriveControllerFixture : public ::testing::Test
9999 " /test_omni_wheel_drive_controller/cmd_vel" , rclcpp::SystemDefaultsQoS ());
100100 }
101101
102+ void TearDown () override
103+ {
104+ // Reset the controller before the fixture is destroyed to ensure the controller's
105+ // shutdown transition (which clears loaned interfaces) runs while the underlying
106+ // StateInterface/CommandInterface objects are still alive. LoanedStateInterface stores
107+ // a const reference (not a shared_ptr), so destruction order matters.
108+ controller_.reset ();
109+ }
110+
102111 static void TearDownTestCase () { rclcpp::shutdown (); }
103112
104113protected:
You can’t perform that action at this time.
0 commit comments