Skip to content

Commit

Permalink
Adding env_steps argument
Browse files Browse the repository at this point in the history
  • Loading branch information
abhihjoshi committed Oct 24, 2024
1 parent bed529c commit d0a3e50
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/test_robots/test_composite_robots.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@
"SpotFloating",
]


def create_and_test_env(env: str, robots: Union[str, List[str]], controller_config: Dict, render=True):
# If you would like to visualize the scene during testing,
# set render to True and increase env_steps to a larger value.
def create_and_test_env(
env: str,
robots: Union[str, List[str]],
controller_config: Dict,
render: bool = True,
env_steps: int = 20,
):

config = {
"env_name": env,
Expand All @@ -54,7 +61,7 @@ def create_and_test_env(env: str, robots: Union[str, List[str]], controller_conf
high = np.clip(high, -1, 1)

# Runs a few steps of the simulation as a sanity check
for i in range(200):
for i in range(env_steps):
action = np.random.uniform(low, high)
obs, reward, done, _ = env.step(action)
if render:
Expand Down

0 comments on commit d0a3e50

Please sign in to comment.