Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because Isaacgym doesn't allow the creation or deletion of actors, I've implemented a workaround which restarts the simulator.
We keep track of the current environment config in the class
IsaacGymWrapper
in the dictself.env_cfg
. Then every call tocompute_action
inMPPIisaacPlanner
we check if the observations contain any relevant changes and updateself.env_cfg
and restart the simulator if required.I've also posted on the isaacgym forum here, to see if there is a better workaround.
Additionally this PR changes the way
MPPIisaacPlanner
andMPPIplanner
interact. Instead of using class inheritenceMPPIplanner
is now simply a property ofMPPIisaacPlanner
because this prevents the abuse of accessingself
in unexpected situations.Edit:
Also I changed the expected signature of the
objective
class method a bit. It now receives the instance ofIsaacGymWrapper
and can thus access all the simulation states to compute it's objective. The old version for instance could not access contact forces because they aren't in the root_states, dof_states, or rigid_body_states