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

How to record higher quality videos? #99

Open
ekarais opened this issue Jan 23, 2021 · 1 comment
Open

How to record higher quality videos? #99

ekarais opened this issue Jan 23, 2021 · 1 comment

Comments

@ekarais
Copy link

ekarais commented Jan 23, 2021

I'm trying out the Model Predictive Control script provided in the docs. I notice that when setting enable_visualization=True when instantiating a CausalWorld environment, the real-time visualization of the CEM is very high resolution, which is great. However, the recording of the CEM obtained via gym.wrappers.monitoring.video_recorder.VideoRecorder has much poorer quality.

Is there a way to record the videos such that their resolution is as good as the real-time visualization, or at least better than what we currently obtain from the VideoRecorder?

I suspect that one would have to modify the render() function of CausalWorld to achieve this, but I don't know what exactly needs to be done.

@michaelfeil
Copy link
Contributor

Have you tried to change the _setup_viewing_camera in the env.render method?

Particularly self._render_width = 320 and self._render_height = 240

def _setup_viewing_camera(self):
"""
Sets up the viewing camera that is used for the render function.
:return:
"""
if self._pybullet_client_w_o_goal_id is not None:
client = self._pybullet_client_w_o_goal_id
else:
client = self._pybullet_client_full_id
self._cam_dist = 0.6
self._cam_yaw = 0
self._cam_pitch = -60
self._render_width = 320
self._render_height = 240
base_pos = [0, 0, 0]
self.view_matrix = pybullet.computeViewMatrixFromYawPitchRoll(
cameraTargetPosition=base_pos,
distance=self._cam_dist,
yaw=self._cam_yaw,
pitch=self._cam_pitch,
roll=0,
upAxisIndex=2,
physicsClientId=client)
self.proj_matrix = pybullet.computeProjectionMatrixFOV(
fov=60,
aspect=float(self._render_width) / self._render_height,
nearVal=0.1,
farVal=100.0,
physicsClientId=client)
return

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

No branches or pull requests

2 participants