
    niD
                         S SK r S SKr\ R                  R                  \R                  R	                  \5      5        S SKrS SKr " S S5      r " S S\5      r	 " S S5      r
g)    Nc                   <    \ rS rSrSrS rS rS rS rS r	S r
S	rg
)Scene   z/A base class for single- and multiplayer scenesc                 (   Xl         [        R                  R                  R	                  S 5      u  U l        nX0l        X@l        U R
                  U R                  -  U l        [        U R                   X#U5      U l	        SU l
        SU l        0 U l        g )NTF)_pgymutilsseeding	np_randomtimestep
frame_skipdtWorld	cpp_worldtest_window_still_openhuman_render_detectedmultiplayer_robots)selfbullet_clientgravityr   r   seeds         V/home/james-whalen/.local/lib/python3.13/site-packages/pybullet_envs/scene_abstract.py__init__Scene.__init__   sr    G99,,66t<DNDM Ommdoo-DG477GzBDN"&D!&D D    c                 (    SU l         U R                  $ )zRCall this function every frame, to see what's going on. Not necessary in learning.T)r   r   r   s    r   test_windowScene.test_window   s    !%D&&&r   c                 X    U R                   (       d  gXR                  UR                  '   g)zUsually after scene resetN)multiplayerr   player_nr   robots     r   actor_introduceScene.actor_introduce   s    V.3ENN+r   c                 $    U R                   (       + $ )z
Used by robots to see if they are free to exclusiveley put their HUD on the test window.
Later can be used for click-focus robots.
)r!   r#   s     r   actor_is_activeScene.actor_is_active#   s    
 r   c                 8    U R                   R                  5         g)zeThis function gets overridden by specific scene, to reset specific objects into their start positionsN)r   clean_everything)r   r   s     r   episode_restartScene.episode_restart*   s    NN##%r   c                 N    U R                   R                  U R                  5        g)z
The idea is: apply motor torques for all robots, then call global_step(), then collect
observations from robots using step() with the same action.
N)r   stepr   r   s    r   global_stepScene.global_step/   s    
 	NN(r   )	r   r   r   r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   r%   r(   r,   r0   __static_attributes__ r   r   r   r      s#    3!'
4
 &
)r   r   c                       \ rS rSrSrSrg)SingleRobotEmptyScene7   Fr8   N)r2   r3   r4   r5   r!   r7   r8   r   r   r:   r:   7   s    +r   r:   c                   &    \ rS rSrS rS rS rSrg)r   ;   c                 b    Xl         X l        X0l        X@l        SU l        U R                  5         g )N   )r   r   r   r   numSolverIterationsr+   )r   r   r   r   r   s        r   r   World.__init__=   s*    GLM O Dr   c                    U R                   R                  SSU R                  * 5        U R                   R                  S5        U R                   R	                  U R
                  U R                  -  U R                  U R                  S9  g )Nr   g?)fixedTimeStepr@   numSubSteps)r   
setGravityr   setDefaultContactERPsetPhysicsEngineParameterr   r   r@   r   s    r   r+   World.clean_everythingE   sg    GGq!dll]+GG  %GG%%DMMDOO4S:>:R:R26// & Cr   c                 8    U R                   R                  5         g )N)r   stepSimulation)r   r   s     r   r/   
World.stepN   s    GGr   )r   r   r   r@   r   N)r2   r3   r4   r5   r   r+   r/   r7   r8   r   r   r   r   ;   s    Cr   r   )sysospathappenddirname__file__pybulletr   r   r:   r   r8   r   r   <module>rS      sL     ) *  
,) ,)^E  r   