Commit a171f206 authored by Kelly Guo's avatar Kelly Guo Committed by Kelly Guo

Fixes various benign warnings in workflows (#513)

# Description

- Avoid printing collision filtering warning in workflows where scene
setup is done through config
- Adds check in collision filter to if /World/collisions already exist
- Avoid warnings in envIds by not enabling it in CPU simulation

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

---------
Signed-off-by: 's avatarrwiltz <165190220+rwiltz@users.noreply.github.com>
Signed-off-by: 's avatarKelly Guo <kellyguo123@hotmail.com>
Signed-off-by: 's avatarAshwin Varghese Kuruttukulam <123109010+ashwinvkNV@users.noreply.github.com>
Signed-off-by: 's avatarKelly Guo <kellyg@nvidia.com>
Signed-off-by: 's avatarMichael Gussert <michael@gussert.com>
Signed-off-by: 's avatarsamibouziri <79418773+samibouziri@users.noreply.github.com>
Signed-off-by: 's avatarMayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Signed-off-by: 's avatarKyle Morgenstein <34984693+KyleM73@users.noreply.github.com>
Signed-off-by: 's avatarHongyu Li <lihongyu0807@icloud.com>
Signed-off-by: 's avatarToni-SM <toni.semu@gmail.com>
Signed-off-by: 's avatarJames Tigue <166445701+jtigue-bdai@users.noreply.github.com>
Signed-off-by: 's avatarPascal Roth <57946385+pascal-roth@users.noreply.github.com>
Signed-off-by: 's avatarVictor Khaustov <3192677+vi3itor@users.noreply.github.com>
Signed-off-by: 's avatarAlvinC <alvincny529@gmail.com>
Signed-off-by: 's avatarTyler Lum <tylergwlum@gmail.com>
Signed-off-by: 's avatarMiguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Signed-off-by: 's avatarrenaudponcelet <renaud.poncelet@gmail.com>
Co-authored-by: 's avatarlotusl-code <lotusl@nvidia.com>
Co-authored-by: 's avatarjaczhangnv <jaczhang@nvidia.com>
Co-authored-by: 's avatarrwiltz <165190220+rwiltz@users.noreply.github.com>
Co-authored-by: 's avatarYanzi Zhu <yanziz@nvidia.com>
Co-authored-by: 's avatarnv-mhaselton <mhaselton@nvidia.com>
Co-authored-by: 's avatarcosmith-nvidia <141183495+cosmith-nvidia@users.noreply.github.com>
Co-authored-by: 's avatarMichael Gussert <michael@gussert.com>
Co-authored-by: 's avatarCY Chen <cyc@nvidia.com>
Co-authored-by: 's avataroahmednv <oahmed@Nvidia.com>
Co-authored-by: 's avatarAshwin Varghese Kuruttukulam <123109010+ashwinvkNV@users.noreply.github.com>
Co-authored-by: 's avatarRafael Wiltz <rwiltz@nvidia.com>
Co-authored-by: 's avatarPeter Du <peterd@nvidia.com>
Co-authored-by: 's avatarmatthewtrepte <mtrepte@nvidia.com>
Co-authored-by: 's avatarchengronglai <chengrongl@nvidia.com>
Co-authored-by: 's avatarpulkitg01 <pulkitg@nvidia.com>
Co-authored-by: 's avatarConnor Smith <cosmith@nvidia.com>
Co-authored-by: 's avatarAshwin Varghese Kuruttukulam <ashwinvk@nvidia.com>
Co-authored-by: 's avatarshauryadNv <shauryad@nvidia.com>
Co-authored-by: 's avatarMayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Co-authored-by: 's avatarsamibouziri <79418773+samibouziri@users.noreply.github.com>
Co-authored-by: 's avatarJames Smith <142246516+jsmith-bdai@users.noreply.github.com>
Co-authored-by: 's avatarShundo Kishi <syundo0730@gmail.com>
Co-authored-by: 's avatarSheikh Dawood <sabdulajees@nvidia.com>
Co-authored-by: 's avatarToni-SM <aserranomuno@nvidia.com>
Co-authored-by: 's avatarGonglitian <70052908+Gonglitian@users.noreply.github.com>
Co-authored-by: 's avatarJames Tigue <166445701+jtigue-bdai@users.noreply.github.com>
Co-authored-by: 's avatarMayank Mittal <mittalma@leggedrobotics.com>
Co-authored-by: 's avatarKyle Morgenstein <34984693+KyleM73@users.noreply.github.com>
Co-authored-by: 's avatarJohnson Sun <20457146+j3soon@users.noreply.github.com>
Co-authored-by: 's avatarPascal Roth <57946385+pascal-roth@users.noreply.github.com>
Co-authored-by: 's avatarHongyu Li <lihongyu0807@icloud.com>
Co-authored-by: 's avatarJean-Francois-Lafleche <57650687+Jean-Francois-Lafleche@users.noreply.github.com>
Co-authored-by: 's avatarWei Jinqi <changshanshi@outlook.com>
Co-authored-by: 's avatarLouis LE LAY <le.lay.louis@gmail.com>
Co-authored-by: 's avatarHarsh Patel <hapatel@theaiinstitute.com>
Co-authored-by: 's avatarKousheek Chakraborty <kousheekc@gmail.com>
Co-authored-by: 's avatarVictor Khaustov <3192677+vi3itor@users.noreply.github.com>
Co-authored-by: 's avatarAlvinC <alvincny529@gmail.com>
Co-authored-by: 's avatarFelipe Mohr <50018670+felipemohr@users.noreply.github.com>
Co-authored-by: 's avatarAdAstra7 <87345760+likecanyon@users.noreply.github.com>
Co-authored-by: 's avatargao <ziqi.gao@iff-extern.fraunhofer.de>
Co-authored-by: 's avatarTyler Lum <tylergwlum@gmail.com>
Co-authored-by: 's avatar-T.K.- <t_k_233@outlook.com>
Co-authored-by: 's avatarClemens Schwarke <96480707+ClemensSchwarke@users.noreply.github.com>
Co-authored-by: 's avatarMiguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Co-authored-by: 's avatarMiguel Alonso Jr. <miguel.alonso@nfinite.app>
Co-authored-by: 's avatarrenaudponcelet <renaud.poncelet@gmail.com>
Co-authored-by: 's avatarAles Borovicka <aborovicka@nvidia.com>
Co-authored-by: 's avatarnv-mm <mmagdics@nvidia.com>
Co-authored-by: 's avatarAntoine RICHARD <antoiner@nvidia.com>
Co-authored-by: 's avatardvangelder-nvidia <dvangelder@nvidia.com>
parent 667d221b
# This is not an extension
# This is not an extension
...@@ -146,7 +146,9 @@ class InteractiveScene: ...@@ -146,7 +146,9 @@ class InteractiveScene:
prim_paths=self.env_prim_paths, prim_paths=self.env_prim_paths,
replicate_physics=False, replicate_physics=False,
copy_from_source=True, copy_from_source=True,
enable_env_ids=self.cfg.filter_collisions, # this won't do anything because we are not replicating physics enable_env_ids=(
self.cfg.filter_collisions if self.device != "cpu" else False
), # this won't do anything because we are not replicating physics
) )
self._default_env_origins = torch.tensor(env_origins, device=self.device, dtype=torch.float32) self._default_env_origins = torch.tensor(env_origins, device=self.device, dtype=torch.float32)
else: else:
...@@ -168,7 +170,7 @@ class InteractiveScene: ...@@ -168,7 +170,7 @@ class InteractiveScene:
prim_paths=self.env_prim_paths, prim_paths=self.env_prim_paths,
base_env_path=self.env_ns, base_env_path=self.env_ns,
root_path=self.env_regex_ns.replace(".*", ""), root_path=self.env_regex_ns.replace(".*", ""),
enable_env_ids=self.cfg.filter_collisions, enable_env_ids=self.cfg.filter_collisions if self.device != "cpu" else False,
) )
# since env_ids is only applicable when replicating physics, we have to fallback to the previous method # since env_ids is only applicable when replicating physics, we have to fallback to the previous method
...@@ -202,17 +204,22 @@ class InteractiveScene: ...@@ -202,17 +204,22 @@ class InteractiveScene:
prim_paths=self.env_prim_paths, prim_paths=self.env_prim_paths,
replicate_physics=self.cfg.replicate_physics, replicate_physics=self.cfg.replicate_physics,
copy_from_source=copy_from_source, copy_from_source=copy_from_source,
enable_env_ids=self.cfg.filter_collisions, # this automatically filters collisions between environments enable_env_ids=(
self.cfg.filter_collisions if self.device != "cpu" else False
), # this automatically filters collisions between environments
) )
# since env_ids is only applicable when replicating physics, we have to fallback to the previous method # since env_ids is only applicable when replicating physics, we have to fallback to the previous method
# to filter collisions if replicate_physics is not enabled # to filter collisions if replicate_physics is not enabled
# additionally, env_ids is only supported in GPU simulation # additionally, env_ids is only supported in GPU simulation
if (not self.cfg.replicate_physics and self.cfg.filter_collisions) or self.device == "cpu": if (not self.cfg.replicate_physics and self.cfg.filter_collisions) or self.device == "cpu":
omni.log.warn( # if scene is specified through cfg, this is already taken care of
"Collision filtering can only be automatically enabled when replicate_physics=True and GPU simulation." if not self._is_scene_setup_from_cfg():
" Please call scene.filter_collisions(global_prim_paths) to filter collisions across environments." omni.log.warn(
) "Collision filtering can only be automatically enabled when replicate_physics=True and using GPU"
" simulation. Please call scene.filter_collisions(global_prim_paths) to filter collisions across"
" environments."
)
# in case of heterogeneous cloning, the env origins is specified at init # in case of heterogeneous cloning, the env origins is specified at init
if self._default_env_origins is None: if self._default_env_origins is None:
...@@ -235,6 +242,10 @@ class InteractiveScene: ...@@ -235,6 +242,10 @@ class InteractiveScene:
# remove duplicates in paths # remove duplicates in paths
global_prim_paths = list(set(global_prim_paths)) global_prim_paths = list(set(global_prim_paths))
# if "/World/collisions" already exists in the stage, we don't filter again
if self.stage.GetPrimAtPath("/World/collisions"):
return
# set global prim paths list if not previously defined # set global prim paths list if not previously defined
if len(self._global_prim_paths) < 1: if len(self._global_prim_paths) < 1:
self._global_prim_paths += global_prim_paths self._global_prim_paths += global_prim_paths
......
...@@ -37,8 +37,8 @@ def sim(): ...@@ -37,8 +37,8 @@ def sim():
yield sim_context yield sim_context
# Cleanup # Cleanup
sim_context.stop() sim_context.stop()
stage_utils.close_stage()
sim_context.clear_instance() sim_context.clear_instance()
stage_utils.close_stage()
def test_instantiation(sim): def test_instantiation(sim):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment