Replies: 1 comment
-
Thank you for posting this. I will move it to our Discussions section for the team to follow up. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hi,
I'm dealing with a robot manipulation RL envs and I'm wondering if it is possible to save the current state of the whole environment and then restore from the save state?
For example, I have to lift a cube to a sequence of target pose, once the robot successed to lift the cube to the first target, save the current state. If the robot failed to move the cube to the next target, reset the env not from the very beginning but from the saved state.
I found some related apis but not sure whether they are the correct one. Seems like only InteractiveScene and ManagerBasedRLEnv
InteractiveScene.get_state, ManagerBasedEnv.reset_to.
I tried to implement one in my direct RL env, however, I noticed that 'InteractiveScene.get_state()' function gets state of all envs, but 'InteractiveScene.reset_to()' receives an additional 'env_ids' parameter to control which envs to reset. In the below 'reset_to' function, the 'env_ids' should also be applied to the saved states, so that it can work normally, but currently no. Please check the following reset_to function code.
In
articulation.write_root_pose_to_sim(root_pose, env_ids=env_ids)
, root_pose comes from the saved state of all envs. Then look at how 'articulation.write_root_pose_to_sim' works:In this line,
self._data.root_state_w[env_ids, :7] = root_pose.clone()
if env_ids is not None, then it is trying to set root_pose of all envs to the selected envs, which will directly raise shape mismatch error. The same thing also happens to 'set_joint_position_target', 'set_joint_velocity_target', 'write_root_velocity_to_sim' functionsI think this might be a bug that needs to be fixed.
Cheers,
Yucheng
Beta Was this translation helpful? Give feedback.
All reactions