Skip to content

Commit

Permalink
Update pybullet.py
Browse files Browse the repository at this point in the history
  • Loading branch information
beneisner authored Apr 16, 2024
1 parent 0d81cc4 commit 58dc828
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/rpad/partnet_mobility_utils/render/pybullet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import logging
import os
import pkgutil
from typing import Dict, List, Literal, Mapping, Optional, Tuple, Union

import numpy as np
Expand Down Expand Up @@ -81,10 +83,19 @@ def __init__(
camera_pos: List = [-2, 0, 2],
gui: bool = False,
with_plane: bool = True,
use_egl: bool = False,
):
self.with_plane = with_plane
self.client_id = p.connect(p.GUI if gui else p.DIRECT)

if use_egl:
egl = pkgutil.get_loader('eglRenderer')
if (egl):
pluginId = p.loadPlugin(pluginPath=egl.get_filename(),postFix="_eglRendererPlugin",physicsClientId=self.client_id)
else:
pluginId = p.loadPlugin("eglRendererPlugin", physicsClientId=self.client_id)
logging.info("pluginId=",pluginId)

# Add in a plane.
if with_plane:
p.setAdditionalSearchPath(pybullet_data.getDataPath())
Expand Down

0 comments on commit 58dc828

Please sign in to comment.