sim_utils
check_collision(prims=None, prims_check=None, prims_exclude=None, step_physics=False)
Checks if any valid collisions occurred during the most recent physics timestep associated with prims @prims
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prims |
None or EntityPrim or RigidPrim or tuple of EntityPrim or RigidPrim
|
Prim(s) to check for collision. If None, will check against all objects currently in the scene. |
None
|
prims_check |
None or EntityPrim or RigidPrim or tuple of EntityPrim or RigidPrim
|
If specified, will only check for collisions with these specific prim(s) |
None
|
prims_exclude |
None or EntityPrim or RigidPrim or tuple of EntityPrim or RigidPrim
|
If specified, will explicitly ignore any collisions with these specific prim(s) |
None
|
step_physics |
bool
|
Whether to step the physics first before checking collisions. Default is False |
False
|
Returns:
Name | Type | Description |
---|---|---|
bool | True if a valid collision has occurred, else False |
Source code in utils/sim_utils.py
filter_collisions(collisions, filter_prims)
Filters collision pairs @collisions based on a set of prims @filter_prims.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collisions |
set of 2-tuple
|
Collision pairs that should be filtered |
required |
filter_prims |
EntityPrim or RigidPrim or tuple of EntityPrim or RigidPrim
|
Prim(s) specifying which collisions to filter for. Any collisions that include prims from this filter set will be removed |
required |
Returns:
Type | Description |
---|---|
set of 2-tuple: Filtered collision pairs |
Source code in utils/sim_utils.py
get_collisions(prims=None, prims_check=None, prims_exclude=None, step_physics=False)
Grab collisions that occurred during the most recent physics timestep associated with prims @prims
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prims |
None or EntityPrim or RigidPrim or tuple of EntityPrim or RigidPrim
|
Prim(s) to check for collision. If None, will check against all objects currently in the scene. |
None
|
prims_check |
None or EntityPrim or RigidPrim or tuple of EntityPrim or RigidPrim
|
If specified, will only check for collisions with these specific prim(s) |
None
|
prims_exclude |
None or EntityPrim or RigidPrim or tuple of EntityPrim or RigidPrim
|
If specified, will explicitly ignore any collisions with these specific prim(s) |
None
|
step_physics |
bool
|
Whether to step the physics first before checking collisions. Default is False |
False
|
Returns:
Type | Description |
---|---|
set of 2-tuple: Unique collision pairs occurring in the simulation at the current timestep between the specified prim(s), represented by their prim_paths |
Source code in utils/sim_utils.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
land_object(obj, pos, quat=None, z_offset=None)
Land the object at the specified position @pos, given a valid position and orientation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
BaseObject
|
Object to place in the environment |
required |
pos |
3-array
|
Global (x,y,z) location to place the object |
required |
quat |
None or 4-array
|
Optional (x,y,z,w) quaternion orientation when placing the object. If None, a random orientation about the z-axis will be sampled |
None
|
z_offset |
None or float
|
Optional additional z_offset to apply |
None
|
Source code in utils/sim_utils.py
place_base_pose(obj, pos, quat=None, z_offset=None)
Place the object so that its base (z-min) rests at the location of @pos
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
BaseObject
|
Object to place in the environment |
required |
pos |
3-array
|
Global (x,y,z) location to place the base of the robot |
required |
quat |
None or 4-array
|
Optional (x,y,z,w) quaternion orientation when placing the object. If None, the object's current orientation will be used |
None
|
z_offset |
None or float
|
Optional additional z_offset to apply |
None
|
Source code in utils/sim_utils.py
prims_to_rigid_prim_set(inp_prims)
Converts prims @inp_prims into its corresponding set of rigid prims
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inp_prims |
list of RigidPrim or EntityPrim
|
Arbitrary prims |
required |
Returns:
Type | Description |
---|---|
set of RigidPrim: Aggregated set of RigidPrims from @inp_prims |
Source code in utils/sim_utils.py
test_valid_pose(obj, pos, quat=None, z_offset=None)
Test if the object can be placed with no collision.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
BaseObject
|
Object to place in the environment |
required |
pos |
3-array
|
Global (x,y,z) location to place the object |
required |
quat |
None or 4-array
|
Optional (x,y,z,w) quaternion orientation when placing the object. If None, the object's current orientation will be used |
None
|
z_offset |
None or float
|
Optional additional z_offset to apply |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool | Whether the placed object position is valid |