# head + tail name pipe read_name_list = [(i + "%s.pipe" % (channel_down + 1)) for i in read_name_down] write_name_list = [(i + "%s.pipe" % (channel_down + 1)) for i in write_name_down] all_path = read_name_list + write_name_list # print(all_path) make_pipe(all_path) obs_pipe_down, touch_pipe_down, reward_pipe_down, over_pipe_down, terminal_pipe_down = open_write_pipe( write_name_list) action_pipe_down, reset_pipe_down = open_read_pipe(read_name_list) CAM_A = Camera("CAM_A") CAM_A.enable(32) CAM_A.recognitionEnable(32) CAM_B = Camera("CAM_B") CAM_B.enable(32) CAM_B.recognitionEnable(32) CAM_C = Camera("CAM_C") CAM_C.enable(32) CAM_C.recognitionEnable(32) CAM_D = Camera("CAM_D") CAM_D.enable(32) CAM_D.recognitionEnable(32) ''' ik code------------------------------------------------------------------------------------------------------ ''' #position Sensor positionSensorList = [] for i in range(7):
# head + tail name pipe read_name_list = [(i + "%s.pipe" % (channel_down + 1)) for i in read_name_down] write_name_list = [(i + "%s.pipe" % (channel_down + 1)) for i in write_name_down] all_path = read_name_list + write_name_list # print(all_path) make_pipe(all_path) obs_pipe_down, touch_pipe_down, reward_pipe_down, over_pipe_down, terminal_pipe_down = open_write_pipe( write_name_list) action_pipe_down, reset_pipe_down = open_read_pipe(read_name_list) CAM_A = Camera("CAM_A") CAM_A.enable(32) CAM_A.recognitionEnable(32) ''' initial_obs, initial_state = initial_step() write_to_pipe([obs_pipe, touch_pipe], [initial_obs, initial_state]) print(np.array(initial_obs).shape, initial_state) ''' initial_state = initial_step() print("init_state: {}".format(initial_state)) write_to_pipe(touch_pipe, initial_state) class TaskType(Enum): UP = 'up_dopamine' DOWN = 'down_dopamine' GRAB = 'grab_ik' POUR = 'pour_ik'