Skip to content

Commit b675c80

Browse files
committed
Unified structure for initialization code
1 parent 5ae50d9 commit b675c80

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/dynamixel_hardware_interface.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,15 +711,21 @@ bool DynamixelHardware::InitDxlWriteItems()
711711
for (const hardware_interface::ComponentInfo & gpio : info_.gpios) {
712712
if (gpio.command_interfaces.size()) {
713713
uint8_t id = static_cast<uint8_t>(stoi(gpio.parameters.at("ID")));
714-
for (auto it : gpio.command_interfaces) {
715714
HandlerVarType temp_write;
716715
temp_write.id = id;
717716
temp_write.name = gpio.name;
718717

719-
temp_write.interface_name_vec.push_back(it.name);
718+
temp_write.interface_name_vec.push_back("Goal Position");
720719
temp_write.value_ptr_vec.push_back(std::make_shared<double>(0.0));
721-
hdl_trans_commands_.push_back(temp_write);
720+
721+
for (auto it : gpio.command_interfaces) {
722+
if (it.name == "Goal Current") {
723+
temp_write.interface_name_vec.push_back("Goal Current");
724+
temp_write.value_ptr_vec.push_back(std::make_shared<double>(0.0));
725+
}
722726
}
727+
728+
hdl_trans_commands_.push_back(temp_write);
723729
}
724730
}
725731
is_set_hdl = true;

0 commit comments

Comments
 (0)