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

fix(render): fix markers are not shown in the rgb array returned by env.render() #61

Merged
merged 3 commits into from
Jan 1, 2023
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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
*.jpeg binary
*.gif binary
*.pdf binary
*.STL binary
*.stl binary
*.PNG binary
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def render_sphere(self, pos, size, color, label='', alpha=0.1):
label=label if self.render_labels else '',
)

# pylint: disable-next=too-many-arguments,too-many-branches
# pylint: disable-next=too-many-arguments,too-many-branches,too-many-statements
def render(self, width, height, mode, camera_id=None, camera_name=None, cost=None):
"""Render the environment to the screen."""
self.model.vis.global_.offwidth = width
Expand Down Expand Up @@ -375,7 +375,7 @@ def render(self, width, height, mode, camera_id=None, camera_name=None, cost=Non
camera_name,
)

self._get_viewer(mode).render(camera_id=camera_id)
self._get_viewer(mode)

if mode == 'human':
self._get_viewer(mode)
Expand Down Expand Up @@ -430,6 +430,7 @@ def render(self, width, height, mode, camera_id=None, camera_name=None, cost=Non

# Draw vision pixels
if mode == 'rgb_array':
self._get_viewer(mode).render(camera_id=camera_id)
data = self._get_viewer(mode).read_pixels(depth=False)
# original image is upside-down, so flip it
self.viewer._markers[:] = [] # pylint: disable=protected-access
Expand Down