コード例 #1
0
    def set_state(self, x, forward=True):
        """Restores qpos and qvel, calling forward() to derive other values.

        :param forward (bool) whether to call forward on the environment.
        """
        state = MujocoState.from_flattened(x, self.sim)
        state.set_mjdata(self.sim.data)
        if forward:
            self.sim.model.forward()  # put mjData in consistent state
コード例 #2
0
 def set_state(self, x):
     state = MujocoState.from_flattened(x, self.sim)
     state.set_mjdata(self.sim.data)
     self.sim.forward()  # put mjData in consistent state
コード例 #3
0
 def set_state(self, x):
     """Restores qpos and qvel, calling forward() to derive other values."""
     state = MujocoState.from_flattened(x, self.sim)
     state.set_mjdata(self.sim.data)
     self.sim.forward()  # put mjData in consistent state