Exemplo n.º 1
0
def test_mj_sim_pool_basics():
    model = load_model_from_xml(BASIC_MODEL_XML)
    sims = [MjSim(model) for _ in range(2)]
    sim_pool = MjSimPool(sims, nsubsteps=2)

    sim_pool.reset()
    sim_pool.step()
    sim_pool.forward()
Exemplo n.º 2
0
def test_mj_sim_pool_basics():
    model = load_model_from_xml(BASIC_MODEL_XML)
    sims = [MjSim(model) for _ in range(2)]
    sim_pool = MjSimPool(sims, nsubsteps=2)

    sim_pool.reset()
    sim_pool.step()
    sim_pool.forward()
Exemplo n.º 3
0
def test_many_sims_rendering():
    model = load_model_from_xml(BASIC_MODEL_XML)
    sims = [MjSim(model) for _ in range(5)]
    pool = MjSimPool(sims)
    pool.forward()
    for sim in sims:
        img, depth = sim.render(200, 200, depth=True)
        assert img.shape == (200, 200, 3)
        compare_imgs(img, 'test_rendering.freecam.png')
Exemplo n.º 4
0
def test_many_sims_rendering():
    model = load_model_from_xml(BASIC_MODEL_XML)
    sims = [MjSim(model) for _ in range(5)]
    pool = MjSimPool(sims)
    pool.forward()
    for sim in sims:
        img, depth = sim.render(200, 200, depth=True)
        assert img.shape == (200, 200, 3)
        compare_imgs(img, 'test_rendering.freecam.png')