Skip to content

Commit 7014d93

Browse files
mergify[bot]Lennart Nachtigall
andauthored
Use tf prefix properly (backport #688) (#725)
Remove tf_prefix workaround in hw interface ros2_control can now accept empty parameters, so this isn't needed anymore. Co-authored-by: Lennart Nachtigall <[email protected]>
1 parent 57b2541 commit 7014d93

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ std::vector<hardware_interface::StateInterface> URPositionHardwareInterface::exp
164164
// Obtain the tf_prefix from the urdf so that we can have the general interface multiple times
165165
// NOTE using the tf_prefix at this point is some kind of workaround. One should actually go through the list of gpio
166166
// state interface in info_ and match them accordingly
167-
std::string tf_prefix = info_.hardware_parameters.at("tf_prefix");
168-
tf_prefix.erase(0, 1);
167+
const std::string tf_prefix = info_.hardware_parameters.at("tf_prefix");
169168
state_interfaces.emplace_back(hardware_interface::StateInterface(tf_prefix + "speed_scaling", "speed_scaling_factor",
170169
&speed_scaling_combined_));
171170

@@ -248,8 +247,8 @@ std::vector<hardware_interface::CommandInterface> URPositionHardwareInterface::e
248247
// Obtain the tf_prefix from the urdf so that we can have the general interface multiple times
249248
// NOTE using the tf_prefix at this point is some kind of workaround. One should actually go through the list of gpio
250249
// command interface in info_ and match them accordingly
251-
std::string tf_prefix = info_.hardware_parameters.at("tf_prefix");
252-
tf_prefix.erase(0, 1);
250+
const std::string tf_prefix = info_.hardware_parameters.at("tf_prefix");
251+
253252
command_interfaces.emplace_back(
254253
hardware_interface::CommandInterface(tf_prefix + "gpio", "io_async_success", &io_async_success_));
255254

0 commit comments

Comments
 (0)