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 dict self.env_cfg. Then every call to compute_action in MPPIisaacPlanner we check if the observations contain any relevant changes and update self.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 and MPPIplanner interact. Instead of using class inheritence MPPIplanner is now simply a property of MPPIisaacPlanner because this prevents the abuse of accessing self in unexpected situations.
Edit:
Also I changed the expected signature of the objective class method a bit. It now receives the instance of IsaacGymWrapper 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
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