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