Skip to content

Commit

Permalink
Use render arguments for debug GUI (#64)
Browse files Browse the repository at this point in the history
* Debug visualizer use render arg

* update version
  • Loading branch information
qgallouedec authored Apr 27, 2023
1 parent f3031c9 commit f645048
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = "Quentin Gallouédec"

# The full version, including alpha/beta/rc tags
release = "v3.0.5"
release = "v3.0.6"


# -- General configuration ---------------------------------------------------
Expand Down
11 changes: 10 additions & 1 deletion panda_gym/envs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,20 @@ def __init__(

self.render_width = render_width
self.render_height = render_height
self.render_target_position = render_target_position
self.render_target_position = (
render_target_position if render_target_position is not None else np.array([0.0, 0.0, 0.0])
)
self.render_distance = render_distance
self.render_yaw = render_yaw
self.render_pitch = render_pitch
self.render_roll = render_roll
with self.sim.no_rendering():
self.sim.place_visualizer(
target_position=self.render_target_position,
distance=self.render_distance,
yaw=self.render_yaw,
pitch=self.render_pitch,
)

def _get_obs(self) -> Dict[str, np.ndarray]:
robot_obs = self.robot.get_obs().astype(np.float32) # robot state
Expand Down
1 change: 0 additions & 1 deletion panda_gym/envs/tasks/flip.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def __init__(
self.obj_range_high = np.array([obj_xy_range / 2, obj_xy_range / 2, 0])
with self.sim.no_rendering():
self._create_scene()
self.sim.place_visualizer(target_position=np.zeros(3), distance=0.9, yaw=45, pitch=-30)

def _create_scene(self) -> None:
"""Create the scene."""
Expand Down
1 change: 0 additions & 1 deletion panda_gym/envs/tasks/pick_and_place.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def __init__(
self.obj_range_high = np.array([obj_xy_range / 2, obj_xy_range / 2, 0])
with self.sim.no_rendering():
self._create_scene()
self.sim.place_visualizer(target_position=np.zeros(3), distance=0.9, yaw=45, pitch=-30)

def _create_scene(self) -> None:
"""Create the scene."""
Expand Down
1 change: 0 additions & 1 deletion panda_gym/envs/tasks/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(
self.obj_range_high = np.array([obj_xy_range / 2, obj_xy_range / 2, 0])
with self.sim.no_rendering():
self._create_scene()
self.sim.place_visualizer(target_position=np.zeros(3), distance=0.9, yaw=45, pitch=-30)

def _create_scene(self) -> None:
self.sim.create_plane(z_offset=-0.4)
Expand Down
1 change: 0 additions & 1 deletion panda_gym/envs/tasks/reach.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(
self.goal_range_high = np.array([goal_range / 2, goal_range / 2, goal_range])
with self.sim.no_rendering():
self._create_scene()
self.sim.place_visualizer(target_position=np.zeros(3), distance=0.9, yaw=45, pitch=-30)

def _create_scene(self) -> None:
self.sim.create_plane(z_offset=-0.4)
Expand Down
1 change: 0 additions & 1 deletion panda_gym/envs/tasks/slide.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def __init__(
self.obj_range_high = np.array([obj_xy_range / 2, obj_xy_range / 2, 0])
with self.sim.no_rendering():
self._create_scene()
self.sim.place_visualizer(target_position=np.zeros(3), distance=0.9, yaw=45, pitch=-30)

def _create_scene(self) -> None:
self.sim.create_plane(z_offset=-0.4)
Expand Down
1 change: 0 additions & 1 deletion panda_gym/envs/tasks/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(
self.obj_range_high = np.array([obj_xy_range / 2, obj_xy_range / 2, 0])
with self.sim.no_rendering():
self._create_scene()
self.sim.place_visualizer(target_position=np.zeros(3), distance=0.9, yaw=45, pitch=-30)

def _create_scene(self) -> None:
self.sim.create_plane(z_offset=-0.4)
Expand Down
2 changes: 1 addition & 1 deletion panda_gym/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.5
3.0.6

0 comments on commit f645048

Please sign in to comment.