#!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/lib')
import random
from dataclasses import dataclass, field
from ObsInfo import ObsInfo


def generate_random_obs(num_obs: int, size_list: list, config_data):
    """
    config_file_name = "config.json"
    json_file = open(config_file_name)
    config_data = json.load(json_file)

    size_list = [length, width, height]

    """

    ObsList = []

    if (num_obs > 0.5):
        for i in range(0, num_obs):
            # random center
            center = [random.uniform(config_data["LAB_SPACE_LIMIT"]["LIMIT_X"][0], config_data["LAB_SPACE_LIMIT"]["LIMIT_X"][1]), \
                random.uniform(config_data["LAB_SPACE_LIMIT"]["LIMIT_Y"][0], config_data["LAB_SPACE_LIMIT"]["LIMIT_Y"][1]), \
                random.uniform(config_data["LAB_SPACE_LIMIT"]["LIMIT_Z"][0], config_data["LAB_SPACE_LIMIT"]["LIMIT_Z"][1])]

            ObsList.append( ObsInfo(center, size_list) )

    return ObsList
[((5, 16, 5, 27), 'os.getcwd', 'os.getcwd', ({}, {}), '()', False, 'import os\n'), ((26, 22, 26, 128), 'random.uniform', 'random.uniform', ({(26, 37, 26, 81): "config_data['LAB_SPACE_LIMIT']['LIMIT_X'][0]", (26, 83, 26, 127): "config_data['LAB_SPACE_LIMIT']['LIMIT_X'][1]"}, {}), "(config_data['LAB_SPACE_LIMIT']['LIMIT_X'][0], config_data[\n    'LAB_SPACE_LIMIT']['LIMIT_X'][1])", False, 'import random\n'), ((27, 16, 27, 122), 'random.uniform', 'random.uniform', ({(27, 31, 27, 75): "config_data['LAB_SPACE_LIMIT']['LIMIT_Y'][0]", (27, 77, 27, 121): "config_data['LAB_SPACE_LIMIT']['LIMIT_Y'][1]"}, {}), "(config_data['LAB_SPACE_LIMIT']['LIMIT_Y'][0], config_data[\n    'LAB_SPACE_LIMIT']['LIMIT_Y'][1])", False, 'import random\n'), ((28, 16, 28, 122), 'random.uniform', 'random.uniform', ({(28, 31, 28, 75): "config_data['LAB_SPACE_LIMIT']['LIMIT_Z'][0]", (28, 77, 28, 121): "config_data['LAB_SPACE_LIMIT']['LIMIT_Z'][1]"}, {}), "(config_data['LAB_SPACE_LIMIT']['LIMIT_Z'][0], config_data[\n    'LAB_SPACE_LIMIT']['LIMIT_Z'][1])", False, 'import random\n'), ((30, 28, 30, 54), 'ObsInfo.ObsInfo', 'ObsInfo', ({(30, 36, 30, 42): 'center', (30, 44, 30, 53): 'size_list'}, {}), '(center, size_list)', False, 'from ObsInfo import ObsInfo\n')]