一、Edit
用Uinity3D打开ai2thor/unity项目进行编辑
二、Build
方法一:
1.修改ai2thor目录下的task.py文件,注释86-89行,并添加一行Unity3D软件的路径
#if os.path.exists(standalone_path):
# unity_path = standalone_path
#else:
# unity_path = unity_hub_path
unity_path = "/home/xw/Unity-2018.3.0f2/Editor/Unity".format(UNITY_VERSION)
2.ai2-thor目录下执行 invoke local-build --arch Linux64, 在ai2-thor/unity/builds 下生成编译好的环境
方法二
在Unity3D软件中File -> Build, 在自定义的目录下生成编译好的环境
三、Run
修改ai2thor库中的Controller.py, local_executable_path='/3rdparty/thor-local-Linux64/thor-local-Linux64.x86_64',
from ai2thor.controller import Controller
controller = Controller(scene='FloorPlan0', gridSize=0.25)
controller.start()