File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 77class MujocoWorldBase (MujocoXML ):
88 """Base class to inherit all mujoco worlds from."""
99
10- def __init__ (self , enable_multiccd = False ):
10+ def __init__ (self , enable_multiccd = False , enable_sleeping = False ):
1111 super ().__init__ (xml_path_completion ("base.xml" ))
1212 # Modify the simulation timestep to be the requested value
1313 options = find_elements (root = self .root , tags = "option" , attribs = None , return_first = True )
1414 options .set ("timestep" , convert_to_string (macros .SIMULATION_TIMESTEP ))
1515 self .enable_multiccd = enable_multiccd
16+ self .enable_sleeping = enable_sleeping
1617 if self .enable_multiccd :
1718 multiccd_elem = ET .fromstring (
1819 """<option> <flag multiccd="enable"/> </option>"""
1920 )
2021 mujoco_elem = find_elements (self .root , "mujoco" )
2122 mujoco_elem .insert (0 , multiccd_elem )
23+ if self .enable_sleeping :
24+ sleeping_elem = ET .fromstring (
25+ """<option> <flag sleep="enable"/> </option>"""
26+ )
27+ mujoco_elem = find_elements (self .root , "mujoco" )
28+ mujoco_elem .insert (0 , sleeping_elem )
2229
You can’t perform that action at this time.
0 commit comments