object_utils
Helper utility functions for computing relevant object information
compute_bbox_offset(obj)
Computes the base link offset of @obj, specifying the relative position of the object's bounding box center wrt to its root link frame, expressed in the world frame
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
BaseObject
|
Object whose bbox offset will be computed |
required |
Returns:
Type | Description |
---|---|
n - array
|
(x,y,z) offset specifying the relative position from the root link to @obj's bounding box center |
Source code in omnigibson/utils/object_utils.py
compute_native_bbox_extent(obj)
Computes the native bounding box extent for @obj, which is the extent with the obj placed at (0, 0, 0) with orientation (0, 0, 0, 1) and scale (1, 1, 1)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
BaseObject
|
Object whose native bbox extent will be computed |
required |
Returns:
Type | Description |
---|---|
n - array
|
(x,y,z) native bounding box extent |
Source code in omnigibson/utils/object_utils.py
compute_obj_kinematic_metadata(obj)
Computes relevant kinematic metadata for @obj, such as stable_orientations, bounding box offsets, bounding box extents, and base_aligned_bboxes
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
BaseObject
|
Object whose metadata will be computed |
required |
Returns:
Type | Description |
---|---|
dict
|
Relevant metadata, with the following keys: |
-stable_orientations
|
2D (N, 4)-array of sampled stable (x,y,z,w) quaternion orientations |
-bbox_offset
|
(x,y,z) relative position from the root link to @obj's bounding box center |
-native_bbox_extent
|
(x,y,z) native bounding box extent |
-base_aligned_bboxes
|
TODO |
Source code in omnigibson/utils/object_utils.py
sample_stable_orientations(obj, n_samples=10, drop_aabb_offset=0.1)
Samples random stable orientations for obj @obj by stochastically dropping the object and recording its resulting orientations
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
BaseObject
|
Object whose orientations will be sampled |
required |
n_samples |
int
|
How many sampled orientations will be recorded |
10
|
drop_aabb_offset |
float
|
Offset to apply in the z-direction when dropping the object |
0.1
|
Returns:
Type | Description |
---|---|
n - array
|
(N, 4) array, where each of the N rows are sampled (x,y,z,w) stable orientations |