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

Actuators Set to Zero on env.reset() #101

Open
nzolman opened this issue Oct 14, 2023 · 0 comments
Open

Actuators Set to Zero on env.reset() #101

nzolman opened this issue Oct 14, 2023 · 0 comments

Comments

@nzolman
Copy link

nzolman commented Oct 14, 2023

Not sure that this is a bug exactly, but thought it should be documented/discussed. If you save a FlowConfig (firedrake) checkpoint where the actuators are not zero and load the checkpoint, the actuators are initialized to the values when they were saved at. However, if this is in a FlowEnv and env.reset() is run, the actuators are set to zero. I would have expected these to be reset to the value the flow was loaded with.

Pseudo-code:

# original environment
env = FlowEnv(config)
env.reset()

action = random_action()
env.step(action)

# non-zero
actuator_states = [actuator.u.values() for actuator in env.flow.actuators]

env.flow.save_checkpoint('/path/to/checkpoint/')

# load the checkpoint into a new FlowEnv
new_config = {'...', 'flow_config': {'restart': '/path/to/checkpoint/'}}
loaded_env = FlowEnv(config)

# same as before the save
loaded_actuator_states = [actuator.u.values() for actuator in loaded_env.flow.actuators]

# These are set to zero.
loaded_env.reset()
reset_actuator_states = [actuator.u.values() for actuator in loaded_env.flow.actuators]

I'm using the latest version on main (commit 38826f4)

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

No branches or pull requests

1 participant