Here we demonstrate how to set up a typical scene in RCareWorld. There are three ways to load a scene

From JSON files

Load a scene from a JSON file

<aside> 💡 JSON files should be placed under Assets/StreamingAssets/SceneData by default. Do not try to move these files.

</aside>

<aside> 💡 You might need to do pip install open3d to proceed.

</aside>

from pyrcareworld.envs import RCareWorld

# Specify the name of the scene configuration file
env = RCareWorld(scene_file='my_new_scene.json')
print(env.instance_channel.data)
while True:
    env._step()

Export scene to a JSON file

Click ExportSceneToJson , it will create a json file under Assets/StreamingAssets/SceneData with the same name as your scene. This json file will record the position and properties of all the objects with XXXAttr .

Screenshot 2023-03-07 at 15.23.01.png

Screenshot 2023-03-07 at 15.24.43.png

From Executable files

Run an environment with an executable file

Run example_tongue.py , you might need to modify the path of the executable file.

from pyrcareworld.envs import RCareWorld

# Specify the path of the exectuable file
env = RCareWorld(executable_file=<path_to_executable>)
while True:
    env._step()

It will load the scene which is the same in Unity. The viewpoint will be the same from the main camera.