Sample symmetric DreamWaQ speed commands
This commit is contained in:
@@ -59,7 +59,7 @@ 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):
|
||||
def test_dreamwaq_commands_are_zero_or_symmetric_without_low_speeds(monkeypatch):
|
||||
task = DreamWaQTask.__new__(DreamWaQTask)
|
||||
task._cfg = SimpleNamespace(
|
||||
commands=SimpleNamespace(
|
||||
@@ -71,6 +71,11 @@ def test_dreamwaq_commands_are_zero_or_forward_between_half_and_one(monkeypatch)
|
||||
"uniform",
|
||||
lambda low, high, size: np.array([0.5, 0.75, 1.0], dtype=np.float32),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
np.random,
|
||||
"choice",
|
||||
lambda values, size: np.array([-1.0, -1.0, 1.0], dtype=np.float32),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
np.random,
|
||||
"random",
|
||||
@@ -79,7 +84,7 @@ def test_dreamwaq_commands_are_zero_or_forward_between_half_and_one(monkeypatch)
|
||||
|
||||
commands = task.resample_commands(3)
|
||||
|
||||
np.testing.assert_array_equal(commands[:, 0], [0.0, 0.75, 1.0])
|
||||
np.testing.assert_array_equal(commands[:, 0], [0.0, -0.75, 1.0])
|
||||
np.testing.assert_array_equal(commands[:, 1:], 0.0)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user