예제 #1
0
def test_object_list():
    client.connect()
    res = client.request('vget /objects')
    obj_ids = res.split(' ')
    assert checker.not_error(res)

    for obj_id in obj_ids:
        color = client.request('vget /object/%s/color' % obj_id)
        assert checker.not_error(color)
예제 #2
0
def test_object_list():
    client.connect()
    res = client.request('vget /objects')
    obj_ids = res.split(' ')
    assert checker.not_error(res)

    for obj_id in obj_ids:
        color = client.request('vget /object/%s/color' % obj_id)
        assert checker.not_error(color)
예제 #3
0
def test_exr_file():
    cmds = [
        'vget /camera/0/depth test.exr',  # This is very likely to fail in Linux
    ]
    client.connect()
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)

        im = imread_file(res)
예제 #4
0
def test_exr_file():
    cmds = [
        'vget /camera/0/depth test.exr', # This is very likely to fail in Linux
    ]
    client.connect()
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)

        im = imread_file(res)
예제 #5
0
def test_pause():
    client.connect()
    cmds = [
        'vset /action/game/pause',
        'vget /camera/0/lit',
        'vget /camera/1/lit',
        'vset /action/game/pause',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)
예제 #6
0
def test_npy_mode():
    """
    Get data as a numpy array
    """
    client.connect()
    cmd = 'vget /camera/0/depth npy'
    res = client.request(cmd)
    assert checker.not_error(res)

    # Do these but without assert, if exception happened, this test failed
    arr = imread_npy(res)
예제 #7
0
def test_camera_control():
    client.connect()
    cmds = [
        'vget /camera/0/location',
        'vget /camera/0/rotation',
        # 'vset /camera/0/location 0 0 0', # BUG: If moved out the game bounary, the pawn will be deleted, so that the server code will crash with a nullptr error.
        # 'vset /camera/0/rotation 0 0 0',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)
예제 #8
0
def test_pause():
    client.connect()
    cmds = [
        'vset /action/game/pause',
        'vget /camera/0/lit',
        'vget /camera/1/lit',
        'vset /action/game/pause',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)
예제 #9
0
def test_npy_mode():
    '''
    Get data as a numpy array
    '''
    client.connect()
    cmd = 'vget /camera/0/depth npy'
    res = client.request(cmd)
    assert checker.not_error(res)

    # Do these but without assert, if exception happened, this test failed
    arr = imread_npy(res)
예제 #10
0
def test_camera_control():
    client.connect()
    cmds = [
        'vget /camera/0/location',
        'vget /camera/0/rotation',
        # 'vset /camera/0/location 0 0 0', # BUG: If moved out the game bounary, the pawn will be deleted, so that the server code will crash with a nullptr error.
        # 'vset /camera/0/rotation 0 0 0',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)
예제 #11
0
def test_file_mode():
    """ Save data to disk as image file """
    client.connect()
    cmds = [
        'vget /camera/0/lit test.png',
        'vget /camera/0/object_mask test.png',
        'vget /camera/0/normal test.png',
        'vget /camera/0/depth test.png',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)

        im = imread_file(res)
예제 #12
0
def test_png_mode():
    """
    Get image as a png binary, make sure no exception happened
    """
    client.connect()
    cmds = [
        'vget /camera/0/lit png',
        'vget /camera/0/object_mask png',
        'vget /camera/0/normal png',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)
        im = imread_png(res)
예제 #13
0
def test_file_mode():
    ''' Save data to disk as image file '''
    client.connect()
    cmds = [
        'vget /camera/0/lit test.png',
        'vget /camera/0/object_mask test.png',
        'vget /camera/0/normal test.png',
        'vget /camera/0/depth test.png',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)

        im = imread_file(res)
예제 #14
0
def test_png_mode():
    '''
    Get image as a png binary, make sure no exception happened
    '''
    client.connect()
    cmds = [
        'vget /camera/0/lit png',
        'vget /camera/0/object_mask png',
        'vget /camera/0/normal png',
    ]
    for cmd in cmds:
        res = client.request(cmd)
        assert checker.not_error(res)
        im = imread_png(res)
예제 #15
0
def test_connection():
    client.connect()
    res = client.request('vget /unrealcv/status')
    assert checker.not_error(res)