-
Notifications
You must be signed in to change notification settings - Fork 12
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
Refactor #1
Refactor #1
Conversation
# see https://gymnasium.farama.org/content/migration-guide/#environment-render | ||
from copy import deepcopy | ||
|
||
model = deepcopy(self.model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried it? Are the actions applied to self.model forwarded to this copy properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the sizes are set properly, I've checked. I should mention however that sizes are only set when using "rgb_array"
, but that's because of the way the WindowViewer
is set by gym. Also when using "human"
because of how the viewer is called the correct "camera0"
is not set by default but that's on gym's side, so you have to hit Tab
to switch to the correct cam:
LGTM, well done! |
Co-authored-by: Quentin Gallouédec <[email protected]>
This integrates
gymnasium_robotics.envs.robot_env.MujocoRobotEnv
intoBase
in order for it to not inherit from agymnasium_robotics.GoalEnv
and instead simply be agym.Env
.It also simplifies a lot of previously entangled code to be much easier to read and comprehend.
Some standard params were added in order to have a similar interface to gym-pusht and aloha:
obs_type
: select the observation type to be returned by the step:"state"
: contains agent and object state vectors only (no rendering)"pixels"
: contains rendered image only (no state vectors)"pixels_agent_pos"
: contains rendered image and agent state vectorobservation_width
,observation_height
: sizes for the observation rendering output byenv.step()
(to be fed to the policy)visualization_width
,visualization_height
: sizes for the visualization rendering, used whenenv.render()
is called (for display in eval)env.render()
will render for observation by default ("rgb_array"
rendering), andenv.render(mode="visualize")
will render for visualization.