Exemple #1
0
    def __init__(self, options={}):
        self.options = options
        if environ.get('TOUCH_DATA') is not None:
            self.options['data_path'] = os.environ['TOUCH_DATA']
        else:
            self.options['data_path'] = '/touch_data'
        self.options['test_split_ratio'] = 0.2
        self.steps = 0

        #TODO check if options is a string, so we know which environment to load
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        pb.setGravity(0, 0, -0.001)
        pb.setRealTimeSimulation(0)
        self.move = 0.01  # 0.01
        self.prev_distance = 10000000
        self.max_steps = 1000
        self.files = None
        self.train_files = None
        self.test_files = None
        self.file_pointer = 0
        self.done_training = False
        self.wandLength = 0.5
        self.wandSide = 0.005
        self.timestep_limit = 400
        self.cameraImageHeight = int((2 * 0.851 * self.wandSide) * 11800)
        self.action_space = spaces.Discrete(6)
        self.observation_space = spaces.Box(
            0, 1, [self.cameraImageHeight, self.cameraImageHeight])
        self.load_files()
    def __init__(self,options={}):
        self.options = options
        #print("options",options)
        self.steps = 0

        currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
        parentdir = os.path.dirname(os.path.dirname(currentdir))
        os.sys.path.insert(0,parentdir)
        #TODO check if options is a string, so we know which environment to load
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        self.timeStep = 0.6 # 0.04 by default
        pb.setPhysicsEngineParameter(fixedTimeStep=self.timeStep)
        pb.setGravity(0,0,0)
        pb.setRealTimeSimulation(0)
        self.move = 0.1 #0.05 # 0.01
        self.pi = 3.1415926535
        self.tinyForce = 5*10e-6
        self.load_object()
        self.load_agent()

        self.pinkId = 0
        self.middleId = 1
        self.indexId = 2
        self.thumbId = 3
        self.ring_id = 4
        self.indexEndID = 21 # Need get position and orientation from index finger parts
        self.offset = 0.02 # Offset from basic position
        self.downCameraOn = False
        self.prev_distance = 10000000
        self.action_space = spaces.Discrete(8)
        self.touch_width = 200
        self.touch_height = 200
    def __init__(self,options={}):
        self.options = options
        self.steps = 0

        #TODO check if options is a string, so we know which environment to load
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        pb.setGravity(0,0,-0.001)
        pb.setRealTimeSimulation(0)
        self.move = 0.015 # 0.01
        self.prev_distance = 10000000
        self.wandLength = 0.3
        self.wandSide = 0.005
        self.max_steps = 1000
        self.eyeOffset = 10e-3#0.26
        self.eye_pos = [0,0,0]
        self.target_pos = [0,0,0]
        self.action_space = spaces.Discrete(8)
        #self.cameraImageHeight = int((2 * 0.851 * self.wandSide)*23600) # yields 200x200 for height**2
        self.cameraImageHeight = int((2 * 0.851 * self.wandSide)*11800*1.2) # 100
        self.cameraImageWidth = int((2 * 0.851*self.wandSide)*11800*1.5) # 150
        # we will have 5 cameras at 125x100, for 5 * 12,500 pixels = 62,500 pixels
        # this helps with the CNN dimensions later
        self.files = None
        self.train_files = None
        self.test_files = None
        self.file_pointer = 0
        self.done_training = False
        self.load_files()
Exemple #4
0
    def __init__(self,options={}):
        self.options = options
        if environ.get('TOUCH_DATA') is not None:
            self.options['data_path'] = os.environ['TOUCH_DATA'] 
        self.steps = 0

        #TODO check if options is a string, so we know which environment to load
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        pb.setGravity(0,0,-0.001)
        pb.setRealTimeSimulation(0)
        self.move = 0.01 # 0.01
        self.prev_distance = 10000000
        self.max_steps = 1000
        self.wandLength = 0.5
        self.wandSide = 0.005
        self.cameraImageHeight = int((2 * 0.851 * self.wandSide)*11800)
        self.class_count = len([x[0] for x in os.walk(self.options['data_path'])]) #path must be a full path,TODO convert to full path
        self.action_space = spaces.Discrete(6 + self.class_count)
        self.timestep_limit = 400
        #self.observation_space = spaces.Box(0, 1, [6,  self.cameraImageHeight, self.cameraImageHeight])
        self.observation_space = spaces.Box(-100, 100, self.cameraImageHeight**2+6)
        self.touch_history = []
Exemple #5
0
    def __init__(self, options={}):
        self.options = options
        self.steps = 0

        currentdir = os.path.dirname(
            os.path.abspath(inspect.getfile(inspect.currentframe())))
        parentdir = os.path.dirname(os.path.dirname(currentdir))
        os.sys.path.insert(0, parentdir)
        #TODO check if options is a string, so we know which environment to load
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        pb.setGravity(0, 0, 0)
        pb.setRealTimeSimulation(0)
        self.move = 0.05  # 0.01
        self.load_object()
        #self.load_agent()
        self.action_space = spaces.Discrete(1)  #smallest discrete is 1
    def __init__(self,options={}):
        self.options = options
        self.steps = 0

        #TODO check if options is a string, so we know which environment to load
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        pb.setGravity(0,0,-0.001)
        pb.setRealTimeSimulation(0)
        self.move = 0.025 # 0.01
        self.prev_distance = 10000000
        self.wandLength = 0.5
        self.wandSide = 0.005
        self.max_steps = 1000
        self.cameraImageHeight = int((2 * 0.851 * self.wandSide)*11800)
        self.action_space = spaces.Discrete(6)
        self.observation_space = spaces.Box(0, 1, [self.cameraImageHeight, self.cameraImageHeight])
Exemple #7
0
    def __init__(self, options={}):
        self.options = options
        #print("options",options)
        self.steps = 0

        currentdir = os.path.dirname(
            os.path.abspath(inspect.getfile(inspect.currentframe())))
        parentdir = os.path.dirname(os.path.dirname(currentdir))
        os.sys.path.insert(0, parentdir)
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        if 'video' in self.options and self.options['video'] != True:
            video_name = self.options[
                'video']  #how to default to video.mp4 is empty
            pb.startStateLogging(pb.STATE_LOGGING_VIDEO_MP4, video_name)
        if 'debug' in self.options and self.options['debug'] == True:
            pb.configureDebugVisualizer(pb.COV_ENABLE_GUI, 1)
            pb.configureDebugVisualizer(pb.COV_ENABLE_TINY_RENDERER, 1)
        else:
            pb.configureDebugVisualizer(pb.COV_ENABLE_GUI, 0)
            pb.configureDebugVisualizer(pb.COV_ENABLE_TINY_RENDERER, 0)
        pb.setGravity(0, 0, -10)
        pb.setRealTimeSimulation(0)
        self.move = 0.05  # 0.01
        self.load_object()
        self.load_agent()
        self.pi = 3.1415926535
        self.pinkId = 0
        self.middleId = 1
        self.indexId = 2
        self.thumbId = 3
        self.ring_id = 4
        self.indexEndID = 21  # Need get position and orientation from index finger parts
        self.offset = 0.02  # Offset from basic position
        self.downCameraOn = False
        self.prev_distance = 10000000
        self.action_space = spaces.Discrete(8)
        self.touch_width = 200
        self.touch_height = 200
        self.observation_space = spaces.Box(
            0, 1, [self.touch_width, self.touch_height])
    def __init__(self, options={}):
        self.options = options
        self.steps = 0
        self.physics = pb

        currentdir = os.path.dirname(
            os.path.abspath(inspect.getfile(inspect.currentframe())))
        parentdir = os.path.dirname(os.path.dirname(currentdir))
        os.sys.path.insert(0, parentdir)
        #TODO check if options is a string, so we know which environment to load
        if 'render' in self.options and self.options['render'] == True:
            pb.connect(pb.GUI)
        else:
            pb.connect(pb.DIRECT)
        #pb.setGravity(10,10,10)
        pb.setGravity(0, 0, -10)
        pb.setRealTimeSimulation(0)
        self.move = 0.01  # 0.01
        self.touched_steps = 0  #how many steps have we touched agent
        self.touch_max_steps_until_death = 10
        self.action_space = spaces.Discrete(6)
Exemple #9
0
 def __init__(self, options={}):
     self.action_space = spaces.Discrete(1)