Skip to content

Commit

Permalink
Merge pull request #12 from wkentaro/mp4
Browse files Browse the repository at this point in the history
Add mp4 option to connect
  • Loading branch information
yijiangh authored Oct 4, 2021
2 parents a4364cc + 4264dda commit cc90e86
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pybullet_planning/interfaces/env_manager/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def restore(self):
set_renderer(enable=self.state)


def connect(use_gui=True, shadows=True, color=None, width=None, height=None):
def connect(use_gui=True, shadows=True, color=None, width=None, height=None, mp4=None):
# Shared Memory: execute the physics simulation and rendering in a separate process
# https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/examples/vrminitaur.py#L7
# make sure to compile pybullet with PYBULLET_USE_NUMPY enabled
Expand All @@ -85,11 +85,13 @@ def connect(use_gui=True, shadows=True, color=None, width=None, height=None):
# options="--mp4=\"test.mp4\" --mp4fps=240"
options = ''
if color is not None:
options += '--background_color_red={} --background_color_green={} --background_color_blue={}'.format(*color)
options += ' --background_color_red={} --background_color_green={} --background_color_blue={}'.format(*color)
if width is not None:
options += '--width={}'.format(width)
options += ' --width={}'.format(width)
if height is not None:
options += '--height={}'.format(height)
options += ' --height={}'.format(height)
if mp4 is not None:
options += ' --mp4={}'.format(mp4)
sim_id = p.connect(method, options=options) # key=None,
#sim_id = p.connect(p.GUI, options="--opengl2") if use_gui else p.connect(p.DIRECT)
assert 0 <= sim_id
Expand Down

0 comments on commit cc90e86

Please sign in to comment.