def RandSampling(param_names_and_range, origin_open_space_params): params_lists = [] for iter in range(0, rand_num): rand_params = planner_open_space_config_pb2.PlannerOpenSpaceConfig() rand_params.CopyFrom(origin_open_space_params) for param in param_names_and_range: exec("rand_params." + str(param[0]) + "=random.uniform(max(rand_params." + str(param[0]) + " - " + str(param[1]) + ",0.0)" + " ,rand_params." + str(param[0]) + " + " + str(param[1]) + ")") params_lists.append(rand_params) return params_lists
def load_open_space_protobuf(filename): open_space_params = planner_open_space_config_pb2.PlannerOpenSpaceConfig() proto_utils.get_pb_from_text_file(filename, open_space_params) return open_space_params