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