def test_get_frame():
    """
    test get frame returns numpy array
    reqs:05, 06
    """
    tracker = NDITracker(SETTINGS_DUMMY)
    _port_handles, _timestamps, _framenumbers, \
        tracking, _tracking_quality = tracker.get_frame()

    assert not tracking

    del tracker
    dummy_two_rom = {
        "tracker type": "dummy",
        "romfiles" : [
            "../data/something_else.rom",
            "../data/8700339.rom"]
        }

    tracker = NDITracker(dummy_two_rom)
    _port_handles, _timestamps, _framenumbers, \
        tracking, _tracking_quality = tracker.get_frame()
    assert len(tracking) == 2
    assert tracking[0].shape == (4, 4)
    assert tracking[0].dtype == 'float64'
示例#2
0
def run():
    """Demonstration program

    Example showing how to initialise, configure, and communicate
    with NDI Polaris, Vega, and Aurora trackers.
    Configuration is by python dictionaries, edit as necessary.

    Dictionaries for other systems:

    settings_polaris = {"tracker type": "polaris",
    "romfiles" : ["../data/8700339.rom"]}

    settings_aurora = { "tracker type": "aurora",
    "ports to use" : [1,2]}

    settings_dummy = {"tracker type": "dummy",}

    """

    settings_vega = {
        "tracker type": "vega",
        "ip address": "192.168.2.17",
        "port": 8765,
        "romfiles": ["../data/8700339.rom", "../data/something_else.rom"]
    }
    tracker = NDITracker(settings_vega)

    tracker.start_tracking()

    six.print_(tracker.get_tool_descriptions())
    for _ in range(20):
        six.print_(tracker.get_frame())
        time.sleep(0.300333)

    tracker.stop_tracking()
    tracker.close()