habitat.datasets.rearrange.samplers.receptacle.AnyObjectReceptacle class

The AnyObjectReceptacle enables any rigid or articulated object or link to be used as a Receptacle without metadata annotation. It uses the top surface of an object’s global space bounding box as a heuristic for the sampling area. The sample efficiency is likely to be poor (especially for concave objects like L-shaped sofas), TODO: this could be mitigated by the option to pre-compute a discrete set of candidate points via raycast upon initialization. Also, this heuristic will not support use of interior surfaces such as cubby and cabinet shelves since volumetric occupancy is not considered.

Note the caveats above and consider that the ideal application of the AnyObjectReceptacle is to support placement of objects onto other simple objects such as open face crates, bins, baskets, trays, plates, bowls, etc… for which receptacle annotation would be overkill.

Methods

def _get_global_bb(self, sim: habitat_sim.simulator.Simulator) -> _magnum.Range3D
Get the global AABB of the Receptacle parent object.
def debug_draw(self, sim: habitat_sim.simulator.Simulator, color: typing.Optional[_magnum.Color4] = None) -> None
Render the Receptacle with DebugLineRender utility at the current frame. Must be called after each frame is rendered, before querying the image data.
def get_global_transform(self, sim: habitat_sim.simulator.Simulator) -> _magnum.Matrix4
Isolates boilerplate necessary to extract receptacle global transform of the Receptacle at the current state.
def sample_uniform_global(self, sim: habitat_sim.simulator.Simulator, sample_region_scale: float) -> _magnum.Vector3
Sample a uniform random point on the top surface of the global bounding box of the object. TODO: If a pre-computed candidate point set was cached, simply sample from those points instead.
def sample_uniform_local(self, sample_region_scale: float = 1.0) -> _magnum.Vector3
Sample a uniform random point within Receptacle in local space. NOTE: This only works if a pointset cache was pre-computed. Otherwise raises an exception.

Special methods

def __init__(self, name: str, parent_object_handle: typing.Optional[str] = None, parent_link: typing.Optional[int] = None)
Initialize the object as a Receptacle.

Properties

bounds: _magnum.Range3D get
AABB of the Receptacle in local space. NOTE: this is an effortful query, not a getter. TODO: This needs a sim instance to compute the global bounding box
is_parent_object_articulated get
Convenience query for articulated vs. rigid object check.

Method documentation

def habitat.datasets.rearrange.samplers.receptacle.AnyObjectReceptacle.debug_draw(self, sim: habitat_sim.simulator.Simulator, color: typing.Optional[_magnum.Color4] = None) -> None

Render the Receptacle with DebugLineRender utility at the current frame. Must be called after each frame is rendered, before querying the image data.

Parameters
sim Simulator must be provided.
color Optionally provide wireframe color, otherwise magenta.

def habitat.datasets.rearrange.samplers.receptacle.AnyObjectReceptacle.sample_uniform_global(self, sim: habitat_sim.simulator.Simulator, sample_region_scale: float) -> _magnum.Vector3

Sample a uniform random point on the top surface of the global bounding box of the object. TODO: If a pre-computed candidate point set was cached, simply sample from those points instead.

Parameters
sim
sample_region_scale defines a XZ scaling of the sample region around its center. No-op for cached points.

def habitat.datasets.rearrange.samplers.receptacle.AnyObjectReceptacle.sample_uniform_local(self, sample_region_scale: float = 1.0) -> _magnum.Vector3

Sample a uniform random point within Receptacle in local space. NOTE: This only works if a pointset cache was pre-computed. Otherwise raises an exception.

Parameters
sample_region_scale defines a XZ scaling of the sample region around its center. For example to constrain object spawning toward the center of a receptacle.