simulation.py
def _gatherSimArgs(self): # {{{0
    "Gather the arguments to pass to the simulation"
    extraKwargs = {}
    # Gather arguments from --config
    if self.args.config is not None:
      for val in self.args.config:
        if "=" in val:
          k, v = val.split("=", 1)
          extraKwargs[k] = v
        else:
          extraKwargs[val] = True
    # Gather general simulation arguments
    if self.args.debug:
      extraKwargs["debug"] = True
    if self.args.frozen:
      extraKwargs["frozen"] = True
    if self.args.radius is not None:
      extraKwargs["objectRadius"] = self.args.radius
    if self.args.mass is not None:
      extraKwargs["objectMass"] = self.args.mass
    extraKwargs["cdp"] = self.args.cdp
    extraKwargs["cdy"] = self.args.cdy
    extraKwargs["cdd"] = self.args.cdd
    extraKwargs["cdtx"] = self.args.cdtx
    extraKwargs["cdty"] = self.args.cdty
    extraKwargs["cdtz"] = self.args.cdtz
    extraKwargs["connectArgs"] = self._gatherBulletArgs()
    if self.args.save:
      extraKwargs["save"] = self.args.save
    if self.args.load:
      extraKwargs["load"] = self.args.load
    if self.args.mp4:
      extraKwargs["mp4"] = self.args.mp4
    if self.args.urdf:
      extraKwargs["urdf"] = self.args.urdf
    if self.args.urdfs:
      urdfs = []
      for g in self.args.urdfs:
        urdfs.extend(glob.glob(g))
      if "urdf" not in extraKwargs:
        extraKwargs["urdf"] = []
      extraKwargs["urdf"].extend(urdfs)
    if self.args.sb:
      extraKwargs["softBodies"] = self.args.sb
    if self.args.rb:
      extraKwargs["rigidBodies"] = self.args.rb
    if self.args.plugin:
      extraKwargs["plugins"] = self.args.plugin
    # Gather engine parameters
    eargs = {}
    if self.args.split_impulse:
      eargs["useSplitImpulse"] = 1
    if self.args.time_step:
      eargs["fixedTimeStep"] = self.args.time_step
    if self.args.erp:
      eargs["erp"] = self.args.erp
    if self.args.contact_erp:
      eargs["contactERP"] = self.args.contact_erp
    if self.args.friction_erp:
      eargs["frictionERP"] = self.args.friction_erp
    if eargs:
      extraKwargs["engineParams"] = eargs
    # Print configuration for debugging
    if self.args.debug:
      connArgs = extraKwargs.get("connectArgs", ())
      camArgs = ("cdp", "cdy", "cdd", "cdtx", "cdty", "cdtz")
      print("Engine arguments: {}".format(" ".join(connArgs)))
      print("Simulation arguments:")
      for key in camArgs:
        if key in extraKwargs:
          print("  Camera step {}: {}".format(key[2:], extraKwargs[key]))
      for key in sorted(extraKwargs):
        if key not in camArgs and key not in ("debug", "connectArgs"):
          print("  {}: {!r}".format(key, extraKwargs[key]))
    return extraKwargs
Gather the arguments to pass to the simulation
Gather the arguments to pass to the simulation
Gather the arguments to pass to the simulation
def _gatherSimArgs(self): 
    extraKwargs = {}
    if self.args.config is not None:
      for val in self.args.config:
        if "=" in val:
          k, v = val.split("=", 1)
          extraKwargs[k] = v
        else:
          extraKwargs[val] = True
    if self.args.debug:
      extraKwargs["debug"] = True
    if self.args.frozen:
      extraKwargs["frozen"] = True
    if self.args.radius is not None:
      extraKwargs["objectRadius"] = self.args.radius
    if self.args.mass is not None:
      extraKwargs["objectMass"] = self.args.mass
    extraKwargs["cdp"] = self.args.cdp
    extraKwargs["cdy"] = self.args.cdy
    extraKwargs["cdd"] = self.args.cdd
    extraKwargs["cdtx"] = self.args.cdtx
    extraKwargs["cdty"] = self.args.cdty
    extraKwargs["cdtz"] = self.args.cdtz
    extraKwargs["connectArgs"] = self._gatherBulletArgs()
    if self.args.save:
      extraKwargs["save"] = self.args.save
    if self.args.load:
      extraKwargs["load"] = self.args.load
    if self.args.mp4:
      extraKwargs["mp4"] = self.args.mp4
    if self.args.urdf:
      extraKwargs["urdf"] = self.args.urdf
    if self.args.urdfs:
      urdfs = []
      for g in self.args.urdfs:
        urdfs.extend(glob.glob(g))
      if "urdf" not in extraKwargs:
        extraKwargs["urdf"] = []
      extraKwargs["urdf"].extend(urdfs)
    if self.args.sb:
      extraKwargs["softBodies"] = self.args.sb
    if self.args.rb:
      extraKwargs["rigidBodies"] = self.args.rb
    if self.args.plugin:
      extraKwargs["plugins"] = self.args.plugin
    eargs = {}
    if self.args.split_impulse:
      eargs["useSplitImpulse"] = 1
    if self.args.time_step:
      eargs["fixedTimeStep"] = self.args.time_step
    if self.args.erp:
      eargs["erp"] = self.args.erp
    if self.args.contact_erp:
      eargs["contactERP"] = self.args.contact_erp
    if self.args.friction_erp:
      eargs["frictionERP"] = self.args.friction_erp
    if eargs:
      extraKwargs["engineParams"] = eargs
    if self.args.debug:
      connArgs = extraKwargs.get("connectArgs", ())
      camArgs = ("cdp", "cdy", "cdd", "cdtx", "cdty", "cdtz")
      print("Engine arguments: {}".format(" ".join(connArgs)))
      print("Simulation arguments:")
      for key in camArgs:
        if key in extraKwargs:
          print("  Camera step {}: {}".format(key[2:], extraKwargs[key]))
      for key in sorted(extraKwargs):
        if key not in camArgs and key not in ("debug", "connectArgs"):
          print("  {}: {!r}".format(key, extraKwargs[key]))
    return extraKwargs
def _gatherSimArgs ( self ) : extraKwargs = { } if self . args . config is not None : for val in self . args . config : if "=" in val : k , v = val . split ( "=" , 1 ) extraKwargs [ k ] = v else : extraKwargs [ val ] = True if self . args . debug : extraKwargs [ "debug" ] = True if self . args . frozen : extraKwargs [ "frozen" ] = True if self . args . radius is not None : extraKwargs [ "objectRadius" ] = self . args . radius if self . args . mass is not None : extraKwargs [ "objectMass" ] = self . args . mass extraKwargs [ "cdp" ] = self . args . cdp extraKwargs [ "cdy" ] = self . args . cdy extraKwargs [ "cdd" ] = self . args . cdd extraKwargs [ "cdtx" ] = self . args . cdtx extraKwargs [ "cdty" ] = self . args . cdty extraKwargs [ "cdtz" ] = self . args . cdtz extraKwargs [ "connectArgs" ] = self . _gatherBulletArgs ( ) if self . args . save : extraKwargs [ "save" ] = self . args . save if self . args . load : extraKwargs [ "load" ] = self . args . load if self . args . mp4 : extraKwargs [ "mp4" ] = self . args . mp4 if self . args . urdf : extraKwargs [ "urdf" ] = self . args . urdf if self . args . urdfs : urdfs = [ ] for g in self . args . urdfs : urdfs . extend ( glob . glob ( g ) ) if "urdf" not in extraKwargs : extraKwargs [ "urdf" ] = [ ] extraKwargs [ "urdf" ] . extend ( urdfs ) if self . args . sb : extraKwargs [ "softBodies" ] = self . args . sb if self . args . rb : extraKwargs [ "rigidBodies" ] = self . args . rb if self . args . plugin : extraKwargs [ "plugins" ] = self . args . plugin eargs = { } if self . args . split_impulse : eargs [ "useSplitImpulse" ] = 1 if self . args . time_step : eargs [ "fixedTimeStep" ] = self . args . time_step if self . args . erp : eargs [ "erp" ] = self . args . erp if self . args . contact_erp : eargs [ "contactERP" ] = self . args . contact_erp if self . args . friction_erp : eargs [ "frictionERP" ] = self . args . friction_erp if eargs : extraKwargs [ "engineParams" ] = eargs if self . args . debug : connArgs = extraKwargs . get ( "connectArgs" , ( ) ) camArgs = ( "cdp" , "cdy" , "cdd" , "cdtx" , "cdty" , "cdtz" ) print ( "Engine arguments: {}" . format ( " " . join ( connArgs ) ) ) print ( "Simulation arguments:" ) for key in camArgs : if key in extraKwargs : print ( "  Camera step {}: {}" . format ( key [ 2 : ] , extraKwargs [ key ] ) ) for key in sorted ( extraKwargs ) : if key not in camArgs and key not in ( "debug" , "connectArgs" ) : print ( "  {}: {!r}" . format ( key , extraKwargs [ key ] ) ) return extraKwargs
Gather the arguments to pass to the simulation
Gather the arguments to pass to the simulation
# {{{0 "Gather the arguments to pass to the simulation" # Gather arguments from --config # Gather general simulation arguments # Gather engine parameters # Print configuration for debugging
self