StanfordVL / iGibson

A Simulation Environment to train Robots in Large Realistic Interactive Scenes
http://svl.stanford.edu/igibson
MIT License
643 stars 157 forks source link

Incorporate custom scene and robot in simulator #216

Open xli4217 opened 2 years ago

xli4217 commented 2 years ago

Hi, I was wondering what is the simplest way is to incorporate custom scenes (from say a matterport scan) into the simulator. Along the same line incorporate new robots in the simulator ? Thank you.

ChengshuLi commented 2 years ago

Hi,

New scene: I assume the custom scene will be static (one single mesh). Then you can probably use "StaticIndoorScene".

https://github.com/StanfordVL/iGibson/blob/master/igibson/scenes/gibson_indoor_scene.py

We have an example scene called Rs_int that you can download with this script. https://github.com/StanfordVL/iGibson/blob/58ac14cf62949008b6851a5a95602cd5084edffd/igibson/utils/assets_utils.py#L299-L312

Once you get your scene to have the same format as Rs_int, you should be able to load it with StaticIndoorScene.

New robot:

This is slightly more complicated. You can add your new robot model into data/assets/models folder. Then you can create your own robot class, following our example implementation of Turtlebot (https://github.com/StanfordVL/iGibson/blob/master/igibson/robots/turtlebot.py) if it's a navigation-only robot or Fetch (https://github.com/StanfordVL/iGibson/blob/master/igibson/robots/fetch.py) if it's a mobile manipulation robot.

Hope this helps.

auto-Dog commented 2 years ago

About adding custom robot, besides adding model and adding robot class, is there anything else to pay attention to? For example, when checking source code, I found this https://github.com/StanfordVL/iGibson/blob/58ac14cf62949008b6851a5a95602cd5084edffd/igibson/envs/env_base.py#L198-L208 If I just add model URDF file and xxxrobot.py as is mentioned above, is it enough to register my robot into REGISTERED_ROBOTS?

My purpose is to add a custom arm robot and follow the example motion_planning_example.py, which load the scene and robot with iGibsonEnv and plans trajectory for the arm robot.

Terrywang2001 commented 3 months ago

@auto-Dog I want to do the same thing as you did, so I am wondering if merely upload the urdf worked?