Sample forward DreamWaQ speed commands

This commit is contained in:
8x54zj-m
2026-07-22 20:03:02 +08:00
parent 509b3d635c
commit 3fa2849123
2 changed files with 35 additions and 7 deletions

View File

@@ -59,6 +59,30 @@ def test_apply_action_advances_three_frame_action_history():
np.testing.assert_array_equal(state.info["current_actions"], 3.0)
def test_dreamwaq_commands_are_zero_or_forward_between_half_and_one(monkeypatch):
task = DreamWaQTask.__new__(DreamWaQTask)
task._cfg = SimpleNamespace(
commands=SimpleNamespace(
forward_speed_range=(0.5, 1.0), stand_probability=0.2
)
)
monkeypatch.setattr(
np.random,
"uniform",
lambda low, high, size: np.array([0.5, 0.75, 1.0], dtype=np.float32),
)
monkeypatch.setattr(
np.random,
"random",
lambda size: np.array([0.1, 0.2, 0.9], dtype=np.float32),
)
commands = task.resample_commands(3)
np.testing.assert_array_equal(commands[:, 0], [0.0, 0.75, 1.0])
np.testing.assert_array_equal(commands[:, 1:], 0.0)
def test_dreamwaq_feet_air_time_matches_upstream_contact_filtering():
task = DreamWaQTask.__new__(DreamWaQTask)
task._cfg = SimpleNamespace(ctrl_dt=0.02)