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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static rendering in MujocoVideoRecorder #85

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

flferretti
Copy link
Collaborator

@flferretti flferretti commented Feb 14, 2024

This PR will add a method in the MujocoVideoRecorder class to return images to be rendered in Python Notebooks.


馃摎 Documentation preview 馃摎: https://jaxsim--85.org.readthedocs.build//85/

@flferretti flferretti self-assigned this Feb 14, 2024
@diegoferigo
Copy link
Member

The logic of the new method you drafted is already in MujocoVideoRecorder.render_frame, but in that case we do not return the rendered frame and instead append it to the stored frames that will be converted to a video.

What about unifying that logic? I mean:

  • Modifying the following method to return a frame without appending to self.frames:
    def render_frame(self, camera_name: str | None = None) -> npt.NDArray:
  • Adding a new method for rendering and appending:
    def record_frame(self, camera_name: str | None = None) -> None:
        frame = self.render_frame(camera_name=camera_name)
        self.frames.append(frame)

Co-authored-by: Diego Ferigo <diego.ferigo@iit.it>
@flferretti flferretti changed the title Add static rendering in MujocoVisualizer Add static rendering in MujocoVideoRecorder Feb 19, 2024
@flferretti flferretti marked this pull request as ready for review February 19, 2024 09:39
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@flferretti flferretti merged commit 6e3da71 into main Feb 20, 2024
21 checks passed
@flferretti flferretti deleted the feature/render_static branch February 20, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants