File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
joint_trajectory_controller
include/joint_trajectory_controller Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
283
283
void resize_joint_trajectory_point_command (
284
284
trajectory_msgs::msg::JointTrajectoryPoint & point, size_t size, double value = 0.0 );
285
285
286
- bool set_scaling_factor (const double scaling_factor);
286
+ bool set_scaling_factor (double scaling_factor);
287
287
using SpeedScalingMsg = control_msgs::msg::SpeedScalingFactor;
288
288
rclcpp::Subscription<SpeedScalingMsg>::SharedPtr scaling_factor_sub_;
289
289
/* *
Original file line number Diff line number Diff line change @@ -987,8 +987,9 @@ controller_interface::CallbackReturn JointTrajectoryController::on_configure(
987
987
}
988
988
else
989
989
{
990
- RCLCPP_WARN (
990
+ RCLCPP_WARN_EXPRESSION (
991
991
logger,
992
+ params.scaling_factor_initial_default != 1.0 ,
992
993
" Speed scaling is currently only supported for position interfaces. If you want to make use "
993
994
" of speed scaling, please only use a position interface when configuring this controller." );
994
995
scaling_factor_ = 1.0 ;
@@ -1756,7 +1757,7 @@ void JointTrajectoryController::resize_joint_trajectory_point_command(
1756
1757
}
1757
1758
}
1758
1759
1759
- bool JointTrajectoryController::set_scaling_factor (const double scaling_factor)
1760
+ bool JointTrajectoryController::set_scaling_factor (double scaling_factor)
1760
1761
{
1761
1762
if (scaling_factor < 0 )
1762
1763
{
@@ -1773,16 +1774,13 @@ bool JointTrajectoryController::set_scaling_factor(const double scaling_factor)
1773
1774
scaling_factor);
1774
1775
}
1775
1776
scaling_factor_.store (scaling_factor);
1776
- if (params_.speed_scaling_command_interface_name .empty ())
1777
- {
1778
- if (!params_.speed_scaling_state_interface_name .empty ())
1777
+ if (params_.speed_scaling_command_interface_name .empty () && !params_.speed_scaling_state_interface_name .empty ())
1779
1778
{
1780
- RCLCPP_WARN (
1779
+ RCLCPP_WARN_ONCE (
1781
1780
get_node ()->get_logger (),
1782
1781
" Setting the scaling factor while only one-way communication with the hardware is setup. "
1783
1782
" This will likely get overwritten by the hardware again. If available, please also setup "
1784
1783
" the speed_scaling_command_interface_name" );
1785
- }
1786
1784
}
1787
1785
else
1788
1786
{
You can’t perform that action at this time.
0 commit comments