From b3950a74b86ff4417321b5238da1bcaab72bee89 Mon Sep 17 00:00:00 2001 From: mahdinobar Date: Fri, 22 Mar 2024 22:53:19 +0100 Subject: [PATCH] adding tworr with PID and SAC environment, dev, #1 --- spinup/backup_gym/gym/envs/classic_control/tworr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spinup/backup_gym/gym/envs/classic_control/tworr.py b/spinup/backup_gym/gym/envs/classic_control/tworr.py index 7c9d6f766..0437c0d7b 100644 --- a/spinup/backup_gym/gym/envs/classic_control/tworr.py +++ b/spinup/backup_gym/gym/envs/classic_control/tworr.py @@ -43,8 +43,8 @@ def __init__(self): self.vyd = 0.05 # m/s deltax = self.vxd * self.dt * self.MAX_TIMESTEPS deltay = self.vyd * self.dt * self.MAX_TIMESTEPS - self.xd = np.linspace(self.xd_init, self.xd_init + deltax, MAX_TIMESTEPS + 1, endpoint=True) - self.yd = np.linspace(self.yd_init, self.yd_init + deltay, MAX_TIMESTEPS + 1, endpoint=True) + self.xd = np.linspace(self.xd_init, self.xd_init + deltax, self.MAX_TIMESTEPS + 1, endpoint=True) + self.yd = np.linspace(self.yd_init, self.yd_init + deltay, self.MAX_TIMESTEPS + 1, endpoint=True) # TODO CHECK high_s = np.array([0.2, 0.2, 1.5, 1.5, 0.5, 0.5, 1, 1]) @@ -213,8 +213,8 @@ def seed(self, seed=None): def reset(self): # initialize at t=-1 - rd_minus1 = np.array([xd[0], yd[0]]) - v_minus1 = np.array([vxd, vyd]) + rd_minus1 = np.array([self.xd[0], self.yd[0]]) + v_minus1 = np.array([self.vxd, self.vyd]) ree_minus1 = rd_minus1 q_hat_soln1, q_hat_soln2 = self.two_link_inverse_kinematics(rd_minus1[0], rd_minus1[1]) q_minus1 = q_hat_soln1