Skip to content

Commit

Permalink
Merge pull request #5 from huggingface/user/aliberts/2024_04_28_remov…
Browse files Browse the repository at this point in the history
…e_warnings

Remove warnings
  • Loading branch information
aliberts authored Apr 28, 2024
2 parents 27e65c9 + cbbaf65 commit 415811f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gym_xarm/tasks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ 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":
observation_space = gym.spaces.Dict(
{
"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
),
}
)
Expand Down
4 changes: 2 additions & 2 deletions gym_xarm/tasks/lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 415811f

Please sign in to comment.