From da97c1068c73422c9ac9e5d8edd135472a5c479c Mon Sep 17 00:00:00 2001 From: FallenSigh Date: Fri, 19 Jun 2026 06:30:11 +0800 Subject: [PATCH] chore: tune keyboard control timing and reduce status output Increase update_rate from 0.05 to 0.03 (faster command cycle), adjust stdin_hold_time from 0.04 to 0.08, and rate-limit console status output to every 5th tick to reduce terminal noise. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- ros2/src/udp_teleop/config/params.yaml | 4 ++-- ros2/src/udp_teleop/udp_teleop/keyboard_control.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ros2/src/udp_teleop/config/params.yaml b/ros2/src/udp_teleop/config/params.yaml index a5cf652..09badf8 100644 --- a/ros2/src/udp_teleop/config/params.yaml +++ b/ros2/src/udp_teleop/config/params.yaml @@ -6,7 +6,7 @@ keyboard_udp_control: chassis_angular_speed: 45 arm_height_step: 5 arm_joint_step: 5 - update_rate: 0.05 + update_rate: 0.03 debug_keys: false keyboard_backend: "auto" - stdin_hold_time: 0.04 + stdin_hold_time: 0.08 diff --git a/ros2/src/udp_teleop/udp_teleop/keyboard_control.py b/ros2/src/udp_teleop/udp_teleop/keyboard_control.py index a09b3ac..6229345 100644 --- a/ros2/src/udp_teleop/udp_teleop/keyboard_control.py +++ b/ros2/src/udp_teleop/udp_teleop/keyboard_control.py @@ -104,6 +104,7 @@ class KeyboardUdpControlNode(Node): self.old_terminal_settings = None self._stdin_buf = "" + self._tick_count = 0 self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) @@ -326,7 +327,9 @@ class KeyboardUdpControlNode(Node): if self.arm_active or self.is_arm_key_pressed(keys): self.sock.sendto(self.build_arm_cmd(), (self.udp_ip, self.udp_port)) - self.print_status(keys) + self._tick_count += 1 + if self._tick_count % 5 == 0: + self.print_status(keys) def print_status(self, keys): selected_joint = self.arm_selected_joint + 2