Skip to content

Commit 38e0ff3

Browse files
committed
Remove unnecessary check for ACTIVE
1 parent 76a9261 commit 38e0ff3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

joint_trajectory_controller/src/joint_trajectory_controller.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,12 @@ controller_interface::return_type JointTrajectoryController::update(
148148
scaling_factor_ = scaling_state_interface_->get().get_value();
149149
}
150150

151-
if (get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
151+
if (scaling_command_interface_.has_value())
152152
{
153-
if (scaling_command_interface_.has_value())
153+
if (!scaling_command_interface_->get().set_value(scaling_factor_cmd_.load()))
154154
{
155-
if (!scaling_command_interface_->get().set_value(scaling_factor_cmd_.load()))
156-
{
157-
RCLCPP_ERROR(
158-
get_node()->get_logger(),
159-
"Could not set speed scaling factor through command interfaces.");
160-
}
155+
RCLCPP_ERROR(
156+
get_node()->get_logger(), "Could not set speed scaling factor through command interfaces.");
161157
}
162158
}
163159

0 commit comments

Comments
 (0)