Skip to content

Commit

Permalink
Support camera in headless visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Feb 23, 2024
1 parent 2fea985 commit 10c7092
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jaxsim/mujoco/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ def reset(

def render_frame(self, camera_name: str | None = None) -> npt.NDArray:
""""""
camera_name = camera_name or "track"

mujoco.mj_forward(self.model, self.data)
self.renderer.update_scene(data=self.data) # TODO camera name
self.renderer.update_scene(data=self.data, camera=camera_name)

return self.renderer.render()

def record_frame(self, camera_name: str | None = None) -> None:
""""""
camera_name = camera_name or "track"

frame = self.render_frame(camera_name=camera_name)
self.frames.append(frame)
Expand Down

0 comments on commit 10c7092

Please sign in to comment.