Fix: Deprecated beerpong env still referenced old mujoco binding
This commit is contained in:
parent
4c8dda3b60
commit
513bf2361e
@ -1,6 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import mujoco_py.builder
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from gymnasium import utils
|
from gymnasium import utils
|
||||||
from gymnasium.envs.mujoco import MujocoEnv
|
from gymnasium.envs.mujoco import MujocoEnv
|
||||||
@ -74,7 +73,6 @@ class BeerPongEnv(MujocoEnv, utils.EzPickle):
|
|||||||
crash = False
|
crash = False
|
||||||
for _ in range(self.repeat_action):
|
for _ in range(self.repeat_action):
|
||||||
applied_action = a + self.sim.data.qfrc_bias[:len(a)].copy() / self.model.actuator_gear[:, 0]
|
applied_action = a + self.sim.data.qfrc_bias[:len(a)].copy() / self.model.actuator_gear[:, 0]
|
||||||
try:
|
|
||||||
self.do_simulation(applied_action, self.frame_skip)
|
self.do_simulation(applied_action, self.frame_skip)
|
||||||
self.reward_function.initialize(self)
|
self.reward_function.initialize(self)
|
||||||
# self.reward_function.check_contacts(self.sim) # I assume this is not important?
|
# self.reward_function.check_contacts(self.sim) # I assume this is not important?
|
||||||
@ -82,8 +80,6 @@ class BeerPongEnv(MujocoEnv, utils.EzPickle):
|
|||||||
self.sim.data.qpos[7::] = self.sim.data.site_xpos[self.site_id("init_ball_pos"), :].copy()
|
self.sim.data.qpos[7::] = self.sim.data.site_xpos[self.site_id("init_ball_pos"), :].copy()
|
||||||
self.sim.data.qvel[7::] = self.sim.data.site_xvelp[self.site_id("init_ball_pos"), :].copy()
|
self.sim.data.qvel[7::] = self.sim.data.site_xvelp[self.site_id("init_ball_pos"), :].copy()
|
||||||
crash = False
|
crash = False
|
||||||
except mujoco_py.builder.MujocoException:
|
|
||||||
crash = True
|
|
||||||
|
|
||||||
ob = self._get_obs()
|
ob = self._get_obs()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user