From 4ca832d81429f1ac63dbed7466381d989d307a6c Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Fri, 21 Jun 2024 10:12:51 +0200 Subject: [PATCH] Throttle info message rate to 5 Hz. --- src/Node.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Node.cpp b/src/Node.cpp index 5db64e3..bb2ab1c 100644 --- a/src/Node.cpp +++ b/src/Node.cpp @@ -188,14 +188,14 @@ void Node::ctrl_loop() motor_right_vel = std::max(motor_right_vel, motor_vel_lower_limit); motor_right_vel = std::min(motor_right_vel, motor_vel_upper_limit); - RCLCPP_INFO(get_logger(), - "actual = %0.2f, target = %0.2f, error = %0.2f, pid_res = %0.2f, LEFT = %0.2f m/s, RIGHT = %0.2f m/s", - _yaw_angular_vel_actual.numerical_value_in(deg/s), - _yaw_angular_vel_target.numerical_value_in(deg/s), - yaw_angular_vel_error.numerical_value_in(deg/s), - pid_res, - motor_left_vel.numerical_value_in(m/s), - motor_right_vel.numerical_value_in(m/s)); + RCLCPP_INFO_THROTTLE(get_logger(), *get_clock(), 20UL, + "actual = %0.2f, target = %0.2f, error = %0.2f, pid_res = %0.2f, LEFT = %0.2f m/s, RIGHT = %0.2f m/s", + _yaw_angular_vel_actual.numerical_value_in(deg/s), + _yaw_angular_vel_target.numerical_value_in(deg/s), + yaw_angular_vel_error.numerical_value_in(deg/s), + pid_res, + motor_left_vel.numerical_value_in(m/s), + motor_right_vel.numerical_value_in(m/s)); pub_motor_left (motor_left_vel); pub_motor_right(motor_right_vel);