def root_with_floor()

in bisk/helpers.py [0:0]


def root_with_floor() -> mjcf.RootElement:
    '''
    Constructs a root element with the commonly used checkered floor.
    '''
    root = mjcf.RootElement()
    if FANCY_SKYBOX:
        root.asset.add(
            'texture',
            type='skybox',
            file=f'{asset_path()}/rainbow.png',
            gridsize=[3, 4],
            gridlayout='.U..LFRB.D..',
        )
    else:
        root.asset.add(
            'texture',
            type='skybox',
            builtin='gradient',
            width=800,
            height=800,
            rgb1=[0.3, 0.5, 0.7],
            rgb2=[0, 0, 0],
        )
    root.asset.add(
        'texture',
        name='tex_plane',
        builtin='checker',
        width=100,
        height=100,
        rgb1=[0.2, 0.3, 0.4],
        rgb2=[0.1, 0.15, 0.2],
        type='2d',
    )
    root.asset.add(
        'material',
        name='mat_plane',
        reflectance=0.5,
        shininess=1,
        specular=1,
        texrepeat=[1, 1],
        texuniform=True,
        texture='tex_plane',
    )
    root.worldbody.add(
        'geom',
        name='floor',
        type='plane',
        size=[100, 100, 100],
        rgba=[0.8, 0.9, 0.8, 1.0],
        conaffinity=1,
        condim=3,
        material='mat_plane',
        pos=[0, 0, 0],
    )
    root.worldbody.add(
        'light',
        cutoff=100,
        diffuse=[1, 1, 1],
        dir=[0, 0, -1.3],
        directional=True,
        exponent=1,
        pos=[0, 0, 1.3],
        specular=[0.1, 0.1, 0.1],
    )
    return root