Skip to content

Commit f1e39b8

Browse files
committed
Remove hardcoded joint prefix
1 parent 7d0eb93 commit f1e39b8

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

abb_hardware_interface/src/abb_hardware_interface.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ CallbackReturn ABBSystemHardware::on_init(const hardware_interface::HardwareInfo
9898

9999
// Get robot controller description from RWS
100100
abb::robot::RWSManager rws_manager(rws_ip, rws_port, "Default User", "robotics");
101-
robot_controller_description_ = abb::robot::utilities::establishRWSConnection(rws_manager, "IRB1200", true);
101+
robot_controller_description_ = abb::robot::utilities::establishRWSConnection(rws_manager, "", true);
102102
}
103103
else
104104
{
@@ -216,14 +216,10 @@ std::vector<hardware_interface::StateInterface> ABBSystemHardware::export_state_
216216
{
217217
for (auto& joint : unit.joints)
218218
{
219-
// TODO(seng): Consider changing joint names in robot description to match what comes
220-
// from the ABB robot description to avoid needing to strip the prefix here
221-
const auto pos = joint.name.find("joint");
222-
const auto joint_name = joint.name.substr(pos);
223219
state_interfaces.emplace_back(
224-
hardware_interface::StateInterface(joint_name, hardware_interface::HW_IF_POSITION, &joint.state.position));
220+
hardware_interface::StateInterface(joint.name, hardware_interface::HW_IF_POSITION, &joint.state.position));
225221
state_interfaces.emplace_back(
226-
hardware_interface::StateInterface(joint_name, hardware_interface::HW_IF_VELOCITY, &joint.state.velocity));
222+
hardware_interface::StateInterface(joint.name, hardware_interface::HW_IF_VELOCITY, &joint.state.velocity));
227223
}
228224
}
229225
}
@@ -239,14 +235,10 @@ std::vector<hardware_interface::CommandInterface> ABBSystemHardware::export_comm
239235
{
240236
for (auto& joint : unit.joints)
241237
{
242-
// TODO(seng): Consider changing joint names in robot description to match what comes
243-
// from the ABB robot description to avoid needing to strip the prefix here
244-
const auto pos = joint.name.find("joint");
245-
const auto joint_name = joint.name.substr(pos);
246238
command_interfaces.emplace_back(hardware_interface::CommandInterface(
247-
joint_name, hardware_interface::HW_IF_POSITION, &joint.command.position));
239+
joint.name, hardware_interface::HW_IF_POSITION, &joint.command.position));
248240
command_interfaces.emplace_back(hardware_interface::CommandInterface(
249-
joint_name, hardware_interface::HW_IF_VELOCITY, &joint.command.velocity));
241+
joint.name, hardware_interface::HW_IF_VELOCITY, &joint.command.velocity));
250242
}
251243
}
252244
}

0 commit comments

Comments
 (0)