|
|
@ -109,14 +109,20 @@ if __name__ == '__main__': |
|
|
tv_img_shm = shared_memory.SharedMemory(create = True, size = np.prod(tv_img_shape) * np.uint8().itemsize) |
|
|
tv_img_shm = shared_memory.SharedMemory(create = True, size = np.prod(tv_img_shape) * np.uint8().itemsize) |
|
|
tv_img_array = np.ndarray(tv_img_shape, dtype = np.uint8, buffer = tv_img_shm.buf) |
|
|
tv_img_array = np.ndarray(tv_img_shape, dtype = np.uint8, buffer = tv_img_shm.buf) |
|
|
|
|
|
|
|
|
if WRIST: |
|
|
|
|
|
|
|
|
if WRIST and args.sim: |
|
|
wrist_img_shape = (img_config['wrist_camera_image_shape'][0], img_config['wrist_camera_image_shape'][1] * 2, 3) |
|
|
wrist_img_shape = (img_config['wrist_camera_image_shape'][0], img_config['wrist_camera_image_shape'][1] * 2, 3) |
|
|
wrist_img_shm = shared_memory.SharedMemory(create = True, size = np.prod(wrist_img_shape) * np.uint8().itemsize) |
|
|
wrist_img_shm = shared_memory.SharedMemory(create = True, size = np.prod(wrist_img_shape) * np.uint8().itemsize) |
|
|
wrist_img_array = np.ndarray(wrist_img_shape, dtype = np.uint8, buffer = wrist_img_shm.buf) |
|
|
wrist_img_array = np.ndarray(wrist_img_shape, dtype = np.uint8, buffer = wrist_img_shm.buf) |
|
|
img_client = ImageClient(tv_img_shape = tv_img_shape, tv_img_shm_name = tv_img_shm.name, |
|
|
img_client = ImageClient(tv_img_shape = tv_img_shape, tv_img_shm_name = tv_img_shm.name, |
|
|
wrist_img_shape = wrist_img_shape, wrist_img_shm_name = wrist_img_shm.name,server_address="127.0.0.1") |
|
|
|
|
|
|
|
|
wrist_img_shape = wrist_img_shape, wrist_img_shm_name = wrist_img_shm.name, server_address="127.0.0.1") |
|
|
|
|
|
elif WRIST and not args.sim: |
|
|
|
|
|
wrist_img_shape = (img_config['wrist_camera_image_shape'][0], img_config['wrist_camera_image_shape'][1] * 2, 3) |
|
|
|
|
|
wrist_img_shm = shared_memory.SharedMemory(create = True, size = np.prod(wrist_img_shape) * np.uint8().itemsize) |
|
|
|
|
|
wrist_img_array = np.ndarray(wrist_img_shape, dtype = np.uint8, buffer = wrist_img_shm.buf) |
|
|
|
|
|
img_client = ImageClient(tv_img_shape = tv_img_shape, tv_img_shm_name = tv_img_shm.name, |
|
|
|
|
|
wrist_img_shape = wrist_img_shape, wrist_img_shm_name = wrist_img_shm.name) |
|
|
else: |
|
|
else: |
|
|
img_client = ImageClient(tv_img_shape = tv_img_shape, tv_img_shm_name = tv_img_shm.name, server_address="127.0.0.1") |
|
|
|
|
|
|
|
|
img_client = ImageClient(tv_img_shape = tv_img_shape, tv_img_shm_name = tv_img_shm.name) |
|
|
|
|
|
|
|
|
image_receive_thread = threading.Thread(target = img_client.receive_process, daemon = True) |
|
|
image_receive_thread = threading.Thread(target = img_client.receive_process, daemon = True) |
|
|
image_receive_thread.daemon = True |
|
|
image_receive_thread.daemon = True |
|
|
|