Exemplo n.º 1
0
    def _generateRBC(self):
        self.obstacles, self.obstacleCenter = [], []

        for i in range(self.config_RBC['numObstacles']):
            name = 'obs' + str(i)
            self.obstacles.append(
                RBCObstacle(np.array(self.config_RBC[name]['center']),
                            self.config_RBC[name]['scale'],
                            np.array(self.config_RBC[name]['orient'])))

            self.obstacleCenter.append(self.obstacles[i].center)
Exemplo n.º 2
0
def obstacleConstructorCallBack(configName = 'config_RBC.json'):

    with open(configName, 'r') as f:
        config = json.load(f)

    obstacles, obstacleCenter = [], []

    for i in range(config['numObstacles']):
        name = 'obs' + str(i)
        obstacles.append(RBCObstacle(np.array(config[name]['center']), config[name]['scale'], np.array(config[name]['orient'])))

        obstacleCenter.append(obstacles[i].center)

    return obstacles, obstacleCenter