allenai / ai2thor

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

Object Dimensions #307

Closed shivanshpatel35 closed 4 years ago

shivanshpatel35 commented 5 years ago

How can I get dimensions of the objects? I was expecting to find that in event.metadata['objects'][i](for i th object) but it does not have dimension information.

winthos commented 5 years ago

This metadata information was previously undocumented, but the Object Attribute Section of the documentation has now been updated to include objectBounds.

Note that this is not an exact measure of the dimensions of an object, but rather the object oriented bounding box that encapsulates the object. Also note that only objects that have the Pickupable attribute have bounds at the moment.

shivanshpatel35 commented 5 years ago

Can we somehow access objectBounds for the objects which have Pickupable attribute False?

winthos commented 5 years ago

Only Pickupable = True objects have object oriented bounds at the moment. We are looking into adding this information to the metadata of all objects in a future release.

Tushar-N commented 4 years ago

Is there a way to get objectBounds for Pickupable = False yet? I thought it would be enough to remove the check for

if(simObj.PrimaryProperty == SimObjPrimaryProperty.CanPickup)
    objMeta.objectBounds = WorldCoordinatesOfBoundingBox(simObj);

in L350 of PhysicsRemoteFPSAgentController.cs and recompile, but looks like Unity does not return bounding boxes for these objects to begin with.

winthos commented 4 years ago

This feature is still in development and will be usable in a future release. Removing that line and recompiling won't do anything because the WorldCoordinatesOfBoundingBox(simobj) function call only works with objects with the tag CanPickup. Trying to use that call on any object will fail unless the object is Pickupable = True

winthos commented 4 years ago

As an update to this issue, the latest release version 2.4.0 now includes a world axis aligned volume that encapsulates all objects, these can be used for extremely rough estimations or volume. Note that because the axisAlignedBoundingBox is aligned to the world axis, if the object rotates then this axis aligned box will change volume. Pickupable objects also still have an object aligned bounding box, which are constant volume regardless of the object rotation.