render flag bug is fixed

This commit is contained in:
Rooholla-KhorramBakht 2024-06-02 19:36:54 -04:00
parent 4922a44251
commit 6b3e6e242f
1 changed files with 8 additions and 4 deletions

View File

@ -68,6 +68,7 @@ class Go2Sim:
self.rot0 = np.array([1., 0., 0., 0.])
self.reset()
mujoco.mj_step(self.model, self.data)
if self.render:
self.viewer.sync()
self.nv = self.model.nv
self.jacp = np.zeros((3, self.nv))
@ -117,6 +118,7 @@ class Go2Sim:
self.rot0 = np.array([1., 0., 0., 0.])
self.reset()
mujoco.mj_step(self.model, self.data)
if self.render:
self.viewer.sync()
def sitDownReset(self):
@ -125,6 +127,7 @@ class Go2Sim:
self.rot0 = np.array([1., 0., 0., 0.])
self.reset()
mujoco.mj_step(self.model, self.data)
if self.render:
self.viewer.sync()
def getJointStates(self):
@ -237,4 +240,5 @@ class Go2Sim:
return False
def close(self):
if self.render:
self.viewer.close()