Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include initial state manager for BipedalWalker #1305

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arthur-plautz
Copy link

@arthur-plautz arthur-plautz commented Feb 10, 2025

Description

The changes described in this PR contribute with the possibility of controlling the terrain generation for the BipedalWalkerV3.
Being able to retrieve and configure a specific terrain for this environment can be very useful for multiple use-cases, by allowing the user to have a greater visibility and control over the terrain.

The TerrainMetadata class was added to manage the read/write operations over random values generated to build the terrain, when calling the env.reset method. The code snippet below showcases the use of the this new functionality:

import gymnasium as gym

env = gym.make('BipedalWalker-v3')

# Use the default reset method / This will populate the `_terrain_metadata` property
env.reset()

# Retrieve the property directly through the `terrain_metadata` method
bipedal_env = env.unwrapped
metadata = bipedal_env.terrain_metadata()

# Use the `options` parameter to pass the terrain metadata and initialize the environment
options = dict(
    metadata=metadata
)
env.reset(options)

Further details on the motivation of this change are described in the referenced issue below.

Fixes # 892

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Member

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting solution

Could you add tests and some general documentation on how to use this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants