Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings #5

Merged
merged 3 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading