How to apply omisafe framework to a customized environment? #255
-
Thanks for your excellent job on the Omnisafe framework! I am a rookie of this area and your work is really helpful. Currently, I want to test some safe reinforcement learning algorithms in a customized environment (https://github.com/google-research/robopianist) and I think this customized environment could be wrapped by the wrapper from the safety-gymnasium. I am wondering how to implement the algorithms from Omisafe on the customized environment or how to add the customized environment to the Omisafe. Thanks for your attention! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Thank you for your support to OmniSafe! We provide interfaces for customizing environments in the
@env_register
class CustomEnv(CMDP):
_support_envs: ClassVar[list[str]] = [
'Custom0-v0',
'Custom1-v0',
'Custom2-v0',
]
self._env = custom_env.make(env_id=env_id, **kwargs) Next, you simply need to refer to the In the previous example, you can run cd examples
python train_policy.py --algo PPOLag --env Custom1-v0 to run |
Beta Was this translation helpful? Give feedback.
Thank you for your support to OmniSafe! We provide interfaces for customizing environments in the
omnisafe/envs
directory. You can refer to the examples provided inomnisafe/envs/safety_gymnasium_env
to customize the environment interface. Key steps include:omnisafe/envs/custom_env.py
CustomEnv
env_register
above the class name to register the environment._support_envs
.self._env
in the__init__
fu…