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:
Type | Description |
---|---|
bool
|
True if a valid collision has occurred, else False |
Source code in omnigibson/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 omnigibson/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 omnigibson/utils/sim_utils.py
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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
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 omnigibson/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 omnigibson/utils/sim_utils.py
prim_paths_to_rigid_prims(prim_paths, scene)
Given a set of rigid body prim paths @body_prim_paths, return a list of (BaseObject, RigidPrim) tuples.
Source code in omnigibson/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 omnigibson/utils/sim_utils.py
set_carb_setting(carb_settings, setting, value)
Convenience function to set settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
setting
|
str
|
Name of setting to change. |
required |
value
|
Any
|
New value for the setting. |
required |
Raises:
Type | Description |
---|---|
TypeError
|
If the type of value does not match setting type. |
Source code in omnigibson/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:
Type | Description |
---|---|
bool
|
Whether the placed object position is valid |