PKU-Alignment / safety-gymnasium

NeurIPS 2023: Safety-Gymnasium: A Unified Safe Reinforcement Learning Benchmark
https://safety-gymnasium.readthedocs.io/en/latest/
Apache License 2.0
402 stars 52 forks source link

feat: support creating navigation environments from config #100

Closed aivarsoo closed 6 months ago

aivarsoo commented 10 months ago

Description

The ability to create the navigation environments from a config dictionary.

Motivation and Context

Addressing the feature request #98.

The feature is required to create custom environments for the navigation tasks. The PR is built with the intent to make minimal changes in the main branch and here are the main changes in the base implementation:

  1. Deeper update of the kwargs in the make method. This is done so that the config is not replaced, but updated.
  2. Changes in the _parse method to parse the goal, hazard, vases etc.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

Checklist

Go over all the following points, and put an x in all the boxes that apply. If you are unsure about any of these, don't hesitate to ask. We are here to help!

muchvo commented 10 months ago

Thank you for your contribution! I appreciate the overall logic of these changes. I will conduct some additional tests to ensure that the modifications do not alter the correctness of the code's outcomes. Once that's confirmed, I'll merge these changes into the main branch.

Bpoole908 commented 7 months ago

Any update on this pull request? This seems like a very useful feature I'd like to utilize.

muchvo commented 7 months ago

Any update on this pull request? This seems like a very useful feature I'd like to utilize.

Based on our current roadmap, this PR is slated for testing and potential integration in the June-July timeframe. I truly appreciate this valuable contribution from the community and am eager to merge this and another PR into our project. However, as I am currently the sole maintainer of this project, my resources are quite limited, which regrettably necessitates some delays. Your understanding and patience in this matter are greatly appreciated.

Bpoole908 commented 7 months ago

No worries! I can use the branch which contains the changes until the official integration. I did notice one limitation of the current implementation is that it seems to only allow for official assets to be passed in the config. It could be useful to somehow allow custom assets (implemented outside the official repo) to be passed to this config as well. I have some ideas for how to adapt the existing implementation but wanted to see what others thoughts were. Apologies if this is outside the scope of this pull request.

muchvo commented 7 months ago

Thank you very much for your understanding!

I did notice one limitation of the current implementation is that it seems to only allow for official assets to be passed in the config. It could be useful to somehow allow custom assets (implemented outside the official repo) to be passed to this config as well.

Regarding the issue you've raised, could you please provide some specific examples or refer to certain files? This would help me to confirm the exact context of our discussion.

I have some ideas for how to adapt the existing implementation but wanted to see what others thoughts were. Apologies if this is outside the scope of this pull request.

Initially, our design was primarily object-oriented to maintain a reasonable program structure and readability. However, customization requires installation from source and direct modification of the source code. We acknowledge this is a limitation and are very keen on making improvements in this area. We highly value any recommendations and code contributions that could better serve the research community. We welcome you to discuss this issue in more detail in a new discussion or a new issue.