Made read_config robuster against CWD
This commit is contained in:
@@ -2,7 +2,10 @@ from __future__ import division
|
||||
|
||||
import numpy as np
|
||||
import cv2
|
||||
try:
|
||||
from naoqi import ALProxy
|
||||
except:
|
||||
ALProxy = None
|
||||
|
||||
|
||||
class NaoImageReader(object):
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
|
||||
def read_config():
|
||||
with open('nao_defaults.json') as f:
|
||||
HERE = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
def read_config(cfg_file=os.path.join(HERE, 'nao_defaults.json')):
|
||||
with open(cfg_file) as f:
|
||||
cfg = json.load(f)
|
||||
return cfg
|
||||
|
||||
Reference in New Issue
Block a user