Skip to content

Commit e8e0fdc

Browse files
Felix ExnerRobertWilbrandt
authored andcommitted
Check command interface name when setting speed scaling
1 parent 6792f6f commit e8e0fdc

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
@@ -1652,8 +1652,13 @@ bool JointTrajectoryController::set_scaling_factor(
16521652
{
16531653
if (get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
16541654
{
1655-
// TODO(Felix): Use proper adressing here.
1656-
command_interfaces_.back().set_value(static_cast<double>(req->scaling_factor));
1655+
for (auto & interface : command_interfaces_)
1656+
{
1657+
if (interface.get_name() == params_.speed_scaling_command_interface_name)
1658+
{
1659+
interface.set_value(static_cast<double>(req->scaling_factor));
1660+
}
1661+
}
16571662
}
16581663
}
16591664
resp->success = true;

0 commit comments

Comments
 (0)