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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -6,7 +6,7 @@ keyboard_udp_control:
|
|||||||
chassis_angular_speed: 45
|
chassis_angular_speed: 45
|
||||||
arm_height_step: 5
|
arm_height_step: 5
|
||||||
arm_joint_step: 5
|
arm_joint_step: 5
|
||||||
update_rate: 0.05
|
update_rate: 0.03
|
||||||
debug_keys: false
|
debug_keys: false
|
||||||
keyboard_backend: "auto"
|
keyboard_backend: "auto"
|
||||||
stdin_hold_time: 0.04
|
stdin_hold_time: 0.08
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ class KeyboardUdpControlNode(Node):
|
|||||||
self.old_terminal_settings = None
|
self.old_terminal_settings = None
|
||||||
|
|
||||||
self._stdin_buf = ""
|
self._stdin_buf = ""
|
||||||
|
self._tick_count = 0
|
||||||
|
|
||||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
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):
|
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.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):
|
def print_status(self, keys):
|
||||||
selected_joint = self.arm_selected_joint + 2
|
selected_joint = self.arm_selected_joint + 2
|
||||||
|
|||||||
Reference in New Issue
Block a user