Exemplo n.º 1
0
def test_parse_joint_properties():
    loader = DartLoader()
    robot = loader.parseSkeleton(get_asset_path('urdf/joint_properties.urdf'))
    assert robot is not None

    world = World.create()
    world.addSkeleton(robot)

    cs = world.getConstraintSolver()
    assert cs is not None

    cd = cs.getCollisionDetector()
    assert cd is not None
Exemplo n.º 2
0
def main():
    root_path = os.path.join(os.path.dirname(__file__), 'assets')
    file_path = os.path.join(root_path, 'wam.urdf')
    urdfLoader = DartLoader()
    urdfLoader.addPackageDirectory("herb_description", root_path)
    wam = urdfLoader.parseSkeleton(file_path)

    world = World.create()
    world.addSkeleton(wam)

    viewer = Viewer(world)

    if sys.flags.interactive == 0:
        viewer.app.run()
Exemplo n.º 3
0
def main():
    root_path = os.path.join(os.path.dirname(__file__), 'assets')
    file_path = os.path.join(root_path, 'wam.urdf')
    urdfLoader = DartLoader()
    urdfLoader.addPackageDirectory("herb_description", root_path)
    wam = urdfLoader.parseSkeleton(file_path)

    world = World.create()
    world.addSkeleton(wam)

    window = SimWindow()
    window.setWorld(world)

    glutInit(sys.argv)
    window.initWindow(640, 480, "Rigid Cubes")
    glutMainLoop()
Exemplo n.º 4
0
def test_parse_joint_properties():
    loader = DartLoader()
    robot = loader.parseSkeleton(get_asset_path('urdf/joint_properties.urdf'))
    assert robot is not None

    joint1 = robot.getJoint(1)
    assert joint1 is not None
    assert joint1.getDampingCoefficient(0) == pytest.approx(1.2, 1e-12)
    assert joint1.getCoulombFriction(0) == pytest.approx(2.3, 1e-12)

    joint2 = robot.getJoint(2)
    assert joint2 is not None
    assert joint2.getPositionLowerLimit(0) == -float("inf")
    assert joint2.getPositionUpperLimit(0) == float("inf")
    if not platform.linux_distribution()[1] == '14.04':
        assert joint2.isCyclic(0)
Exemplo n.º 5
0
def test_parse_skeleton_non_existing_path_returns_null():
    loader = DartLoader()
    assert loader.parseSkeleton(
        get_asset_path('skel/test/does_not_exist.urdf')) is None
Exemplo n.º 6
0
def test_parse_skeleton_loads_primitive_geometry():
    loader = DartLoader()
    assert loader.parseSkeleton(
        get_asset_path('urdf/primitive_geometry.urdf')) is not None
Exemplo n.º 7
0
def test_parse_skeleton_missing_package_returns_null():
    loader = DartLoader()
    assert loader.parseSkeleton(
        get_asset_path('urdf/missing_package.urdf')) is None
Exemplo n.º 8
0
def test_parse_skeleton_invalid_mesh_returns_null():
    loader = DartLoader()
    assert loader.parseSkeleton(
        get_asset_path('urdf/invalid_mesh.urdf')) is None
Exemplo n.º 9
0
def test_parse_joint_properties():
    loader = DartLoader()
    robot = loader.parseSkeleton(get_asset_path('urdf/test/joint_properties.urdf'))
    assert robot is not None
Exemplo n.º 10
0
def test_parse_skeleton_non_existing_path_returns_null():
    assert os.path.isfile(get_asset_path('skel/cubes.skel')) is True
    loader = DartLoader()
    assert loader.parseSkeleton(get_asset_path('skel/test/does_not_exist.urdf')) is None