Skip to content

Commit b04371a

Browse files
committed
adapt admittance_controller tests
1 parent 167b210 commit b04371a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

admittance_controller/test/test_admittance_controller.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class AdmittanceControllerTest : public ::testing::Test
201201

202202
for (auto i = 0u; i < joint_command_values_.size(); ++i)
203203
{
204-
command_itfs_.emplace_back(hardware_interface::CommandInterface(
204+
command_itfs_.emplace_back(std::make_shared<hardware_interface::CommandInterface>(
205205
joint_names_[i], command_interface_types_[0], &joint_command_values_[i]));
206206
command_ifs.emplace_back(command_itfs_.back());
207207
}
@@ -216,7 +216,7 @@ class AdmittanceControllerTest : public ::testing::Test
216216

217217
for (auto i = 0u; i < joint_state_values_.size(); ++i)
218218
{
219-
state_itfs_.emplace_back(hardware_interface::StateInterface(
219+
state_itfs_.emplace_back(std::make_shared<hardware_interface::StateInterface>(
220220
joint_names_[i], state_interface_types_[0], &joint_state_values_[i]));
221221
state_ifs.emplace_back(state_itfs_.back());
222222
}
@@ -226,7 +226,7 @@ class AdmittanceControllerTest : public ::testing::Test
226226

227227
for (auto i = 0u; i < fts_state_names_.size(); ++i)
228228
{
229-
state_itfs_.emplace_back(hardware_interface::StateInterface(
229+
state_itfs_.emplace_back(std::make_shared<hardware_interface::StateInterface>(
230230
ft_sensor_name_, fts_itf_names[i], &fts_state_values_[i]));
231231
state_ifs.emplace_back(state_itfs_.back());
232232
}
@@ -397,8 +397,8 @@ class AdmittanceControllerTest : public ::testing::Test
397397
std::array<double, 6> fts_state_values_ = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
398398
std::vector<std::string> fts_state_names_;
399399

400-
std::vector<hardware_interface::StateInterface> state_itfs_;
401-
std::vector<hardware_interface::CommandInterface> command_itfs_;
400+
std::vector<std::shared_ptr<hardware_interface::StateInterface>> state_itfs_;
401+
std::vector<std::shared_ptr<hardware_interface::CommandInterface>> command_itfs_;
402402

403403
// Test related parameters
404404
std::unique_ptr<TestableAdmittanceController> controller_;

gripper_controllers/test/test_gripper_controllers.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ class GripperControllerTest : public ::testing::Test
5757
std::vector<double> joint_states_ = {1.1, 2.1};
5858
std::vector<double> joint_commands_ = {3.1};
5959

60-
StateInterface joint_1_pos_state_{joint_name_, HW_IF_POSITION, &joint_states_[0]};
61-
StateInterface joint_1_vel_state_{joint_name_, HW_IF_VELOCITY, &joint_states_[1]};
62-
CommandInterface joint_1_pos_cmd_{joint_name_, HW_IF_POSITION, &joint_commands_[0]};
60+
std::shared_ptr<StateInterface> joint_1_pos_state_ =
61+
std::make_shared<StateInterface>(joint_name_, HW_IF_POSITION, &joint_states_[0]);
62+
std::shared_ptr<StateInterface> joint_1_vel_state_ =
63+
std::make_shared<StateInterface>(joint_name_, HW_IF_VELOCITY, &joint_states_[1]);
64+
std::shared_ptr<CommandInterface> joint_1_pos_cmd_ =
65+
std::make_shared<CommandInterface>(joint_name_, HW_IF_POSITION, &joint_commands_[0]);
6366
};
6467

6568
#endif // TEST_GRIPPER_CONTROLLERS_HPP_

0 commit comments

Comments
 (0)