Пример #1
0
def test_possible_positions_three_upward():
    # Arrange
    rc = RobotConfiguration.from_data(items_three_upward)

    # Act
    result = possible_positions(rc, 2)

    # Assert
    assert np.array_equal(result[0], np.array([0.0, 0.0, 3.0]))
Пример #2
0
def test_possible_positions_two_num_iter():
    # Arrange
    rc = RobotConfiguration.from_data(items_two_upwards)
    num_iter = 2

    # Act
    result = possible_positions(rc, num_iter)

    # Assert
    assert len(result) == num_iter
Пример #3
0
def test_possible_positions_three_num_iter():
    # Arrange
    rc = RobotConfiguration.from_data(items_three)
    num_iter = 2

    # Act
    result = possible_positions(rc, num_iter)

    # Assert
    assert len(result) == pow(num_iter, 2)
Пример #4
0
def get_locus_of_design_id(design_id):
    """
    Get locus of design by id

    :param design_id: Id of design
    :return:
    """
    existing_design = storage.get_design(UUID(design_id))
    if existing_design is None:
        abort(400)
    result = execution.possible_positions(existing_design.robot, 40)
    output = list(
        map(
            lambda x: {
                'position': {
                    'x': x['position'][0],
                    'z': x['position'][1],
                    'y': x['position'][2]
                },
                'configuration': x['configuration']
            }, result))
    return jsonify(output)