清理多余策略

This commit is contained in:
meiqi
2026-03-30 15:30:30 +08:00
parent 32702e25f3
commit cc1f766009
19 changed files with 3 additions and 929 deletions

View File

@@ -84,7 +84,6 @@ python3 udp_loopback/udp_xbox_sender.py
- `A -> mode_stride -> gotoWALKAMP`
- `X -> pose_home -> gotoZERO`
- `Y -> pose_hold -> gotoSTOP`
- `B -> mode_dash -> gotoMYPOLICY`
- `START -> trim_reset`
- 左摇杆 Y -> 连续前后速度
- 左摇杆 X -> 连续横移速度
@@ -96,7 +95,6 @@ python3 udp_loopback/udp_xbox_sender.py
- `pose_home -> gotoZERO`
- `pose_hold -> gotoSTOP`
- `mode_stride -> gotoWALKAMP`
- `mode_dash -> gotoMYPOLICY`
- `surge/sway/spin -> x/y/yaw speed command`
当前事件码不是原工程里的 `gotoZERO` / `gotoSTOP` / `x_speed_command` 这一套,而是:
@@ -104,7 +102,6 @@ python3 udp_loopback/udp_xbox_sender.py
- `pose_home`
- `pose_hold`
- `mode_stride`
- `mode_dash`
- `surge_up`
- `surge_down`
- `sway_left`

View File

@@ -161,12 +161,6 @@ class UDPFSMController:
elif event_code == "mode_stride":
self.motion_frame.mode_tag = "mode_stride"
self.last_fsm_command_time = packet.sent_at
elif event_code == "mode_dash":
self.motion_frame.mode_tag = "mode_dash"
self.last_fsm_command_time = packet.sent_at
elif event_code == "mode_xrun":
self.motion_frame.mode_tag = "mode_xrun"
self.last_fsm_command_time = packet.sent_at
elif event_code == "surge_up":
self.motion_frame.surge_goal = min(
self.max_surge, self.motion_frame.surge_goal + self.surge_step
@@ -236,8 +230,6 @@ class UDPFSMController:
"pose_home": "gotoZERO",
"pose_hold": "gotoSTOP",
"mode_stride": "gotoWALKAMP",
"mode_dash": "gotoMYPOLICY",
"mode_xrun": "gotoXSIMRUN",
}
self.udp_flag.enable = self.motion_frame.relay_on
self.udp_flag.fsm_state_command = mode_to_fsm_command.get(

View File

@@ -56,8 +56,6 @@ class UDPKeyboardSender:
print(" z -> pose_home")
print(" c -> pose_hold")
print(" m -> mode_stride")
print(" p -> mode_dash")
print(" n -> mode_xrun")
print(" w/s -> surge +/-")
print(" a/d -> sway +/-")
print(" q/e -> spin +/-")
@@ -118,8 +116,6 @@ class UDPKeyboardSender:
"z": ("pose_home", "z", 1.0),
"c": ("pose_hold", "c", 1.0),
"m": ("mode_stride", "m", 1.0),
"p": ("mode_dash", "p", 1.0),
"n": ("mode_xrun", "n", 1.0),
"r": ("trim_reset", "r", 1.0),
"4": ("set_surge", "4", 0.0),
"5": ("set_sway", "5", 0.0),

View File

@@ -138,10 +138,6 @@ class UDPLoopbackNode:
self.motion_frame.mode_tag = "pose_hold"
elif event_code == "mode_stride":
self.motion_frame.mode_tag = "mode_stride"
elif event_code == "mode_dash":
self.motion_frame.mode_tag = "mode_dash"
elif event_code == "mode_xrun":
self.motion_frame.mode_tag = "mode_xrun"
elif event_code == "surge_up":
self.motion_frame.surge_goal = min(
self.max_surge, self.motion_frame.surge_goal + self.surge_step

View File

@@ -44,7 +44,7 @@ class UDPXboxSender(Node):
f"Forwarding {self.joy_topic} -> udp://{self.target_host}:{self.target_port}"
)
self.get_logger().info(
"Buttons: A=WALKAMP X=ZERO Y=STOP B=MYPOLICY START=reset"
"Buttons: A=WALKAMP X=ZERO Y=STOP START=reset"
)
def destroy_node(self) -> bool:
@@ -167,13 +167,6 @@ class UDPXboxSender(Node):
self._send_event("pose_home", "x")
elif self._rising_edge(state, "a"):
self._send_event("mode_stride", "a")
elif self._rising_edge(state, "b"):
self._send_event("mode_dash", "b")
elif (
self._rising_edge(state, "home")
and state["l_trigger"] < self.trigger_pressed_threshold
):
self._send_event("mode_xrun", "home")
def _send_trim_event(self, state: Dict[str, float]) -> None:
if self._rising_edge(state, "start"):