class_docstr: Adds physics simulation on top of kb.Scene using PyBullet.
class_docstr_tok: ["Adds","physics","simulation","on","top","of","kb.Scene","using","PyBullet","."]
code: def __init__(self, scene: core.Scene, scratch_dir=tempfile.mkdtemp()):
      self.scratch_dir = scratch_dir
      self._physics_client = _BulletClient(pb.DIRECT)  # pb.GUI
  
      # --- Set some parameters to fix the sticky-walls problem; see
      # https://github.com/bulletphysics/bullet3/issues/3094
      self._physics_client.setPhysicsEngineParameter(
          restitutionVelocityThreshold=0.0,
          warmStartingFactor=0.0,
          useSplitImpulse=True,
          contactSlop=0.0,
          enableConeFriction=False,
          deterministicOverlappingPairs=True,
      )
      # TODO: setTimeStep if scene.step_rate != 240 Hz
      super().__init__(
          scene,
          scene_observers={
              "gravity": [
                  lambda change: self._physics_client.setGravity(
                      *change.new
                  )
              ],
          },
      )
  
imports: import functools
  import inspect
  import logging
  import pathlib
  import sys
  import tempfile
  from typing import Dict, List, Optional, Tuple, Union
  import tensorflow
  from singledispatchmethod import singledispatchmethod
  from kubric import core
  from kubric.redirect_io import RedirectStream
label_desc: Use image node_id 1 to create a new PyBullet object from inherited base classes: core with example: obj = PyBullet(scene, scratch_dir)