allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.09k stars 210 forks source link

Questions about ReceptacleRestrictions in SimObjType.cs #1139

Closed twoongg closed 1 year ago

twoongg commented 1 year ago

Hi I am customizing scenes by adding extra objects. I am wondering do I have to declare every new receptacles inside ReceptacleRestrictions in SimObjType.cs ? It seems that I can add Receptacles property although I didn't edit ReceptacleRestrictions. And for objects that are not receptacles, what happens if I don't delcare it inside PlacementRestrictions ?

Thanks in advance.

winthos commented 1 year ago

The Receptacle Restrictions are only used when using iTHOR's default agent PutObject actions. By default, if forceAction = false is passed in to the PutObject action, only objects defined by the ReceptacleRestrictions will allowed to be placed in a valid target receptacle. An example is that by default, ToiletPaper does not go inside a Fridge typed receptacle unless forceAction = true is passed in, allowing it to ignore those restrictions.

These restrictions are are mostly in place because the PutObject action shares some backend logic with actions like InitialRandomSpawn, and thus using these restrictions we can, by default, enforce objects don't get randomly positioned in placed that don't make much sense (ie: putting toilet paper in the fridge).

So if you are just taking receptacle objects from our asset library, or other scenes, and adding them to a scene, you don't need to do anything like declare those new receptacles in the ReceptacleRestrictions as they should already be in there. If you are adding a whole new type of receptacle, you can choose to ignore adding in the restrictions for the novel receptacle if you don't care about default restriction behaviors.

twoongg commented 1 year ago

Thanks! Now I understood. I really appreceiate your help