diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f6711d..068cc50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,7 +98,7 @@ jobs: - name: Run tests run: | source .venv/bin/activate - pytest --cov=./gym_pusht --cov-report=xml tests + pytest --cov=./gym_xarm tests # TODO(aliberts): Link with HF Codecov account # - name: Upload coverage reports to Codecov with GitHub Action diff --git a/gym_xarm/tasks/base.py b/gym_xarm/tasks/base.py index 44550da..68c8f43 100644 --- a/gym_xarm/tasks/base.py +++ b/gym_xarm/tasks/base.py @@ -111,7 +111,7 @@ def _initialize_observation_space(self): image_shape = (self.observation_height, self.observation_width, 3) obs = self.get_obs() if self.obs_type == "state": - observation_space = gym.spaces.Box(-np.inf, np.inf, shape=obs.shape, dtype=np.float64) + observation_space = gym.spaces.Box(-1000.0, 1000.0, shape=obs.shape, dtype=np.float64) elif self.obs_type == "pixels": observation_space = gym.spaces.Box(low=0, high=255, shape=image_shape, dtype=np.uint8) elif self.obs_type == "pixels_agent_pos": @@ -119,7 +119,7 @@ def _initialize_observation_space(self): { "pixels": gym.spaces.Box(low=0, high=255, shape=image_shape, dtype=np.uint8), "agent_pos": gym.spaces.Box( - low=-np.inf, high=np.inf, shape=obs["agent_pos"].shape, dtype=np.float64 + low=-1000.0, high=1000.0, shape=obs["agent_pos"].shape, dtype=np.float64 ), } ) diff --git a/gym_xarm/tasks/lift.py b/gym_xarm/tasks/lift.py index 4ecd0c2..00457b0 100644 --- a/gym_xarm/tasks/lift.py +++ b/gym_xarm/tasks/lift.py @@ -78,8 +78,8 @@ def _sample_goal(self): # Object object_pos = self.center_of_table - np.array([0.15, 0.10, 0.07]) - object_pos[0] += self.np_random.uniform(-0.05, 0.05, size=1) - object_pos[1] += self.np_random.uniform(-0.05, 0.05, size=1) + object_pos[0] += self.np_random.uniform(-0.05, 0.05) + object_pos[1] += self.np_random.uniform(-0.05, 0.05) object_qpos = self._utils.get_joint_qpos(self.model, self.data, "object_joint0") object_qpos[:3] = object_pos self._utils.set_joint_qpos(self.model, self.data, "object_joint0", object_qpos)