Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Throttle info message rate to 5 Hz.
Browse files Browse the repository at this point in the history
  • Loading branch information
aentinger committed Jun 21, 2024
1 parent f09bd9c commit 4ca832d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4ca832d

Please sign in to comment.