Skip to content

Commit 00c753d

Browse files
author
Felix Exner
committed
Check command interface name when setting speed scaling
1 parent 9851eac commit 00c753d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

joint_trajectory_controller/src/joint_trajectory_controller.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,8 +1658,13 @@ bool JointTrajectoryController::set_scaling_factor(
16581658
{
16591659
if (get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
16601660
{
1661-
// TODO(Felix): Use proper adressing here.
1662-
command_interfaces_.back().set_value(static_cast<double>(req->scaling_factor));
1661+
for (auto & interface : command_interfaces_)
1662+
{
1663+
if (interface.get_name() == params_.speed_scaling_command_interface_name)
1664+
{
1665+
interface.set_value(static_cast<double>(req->scaling_factor));
1666+
}
1667+
}
16631668
}
16641669
}
16651670
resp->success = true;

0 commit comments

Comments
 (0)