-
Notifications
You must be signed in to change notification settings - Fork 857
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes the visualization markers to use the SpawnerCfg class (#162)
# Description * This MR fixes the `VisualizationMarkers` class to use the `SpawnerCfg`. This makes it consistent with how assets are spawned and allows more variations. * The markers also support instanceable meshes. This is done by disabling their instancing (as PointInstancer does not support pre-instanced assets) and removing any rigid body APIs from the asset. Fixes #144 ## Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update ## Screenshots https://github.com/isaac-orbit/orbit/assets/12863862/9d1b095b-99ee-4759-ba30-6175cc3b7d78 ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./orbit.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file
- Loading branch information
Showing
22 changed files
with
481 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 90 additions & 52 deletions
142
source/extensions/omni.isaac.orbit/omni/isaac/orbit/markers/config/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,124 @@ | ||
# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES, ETH Zurich, and University of Toronto | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
from __future__ import annotations | ||
|
||
import omni.isaac.orbit.sim as sim_utils | ||
from omni.isaac.orbit.markers.visualization_markers import VisualizationMarkersCfg | ||
from omni.isaac.orbit.utils.assets import ISAAC_NUCLEUS_DIR | ||
|
||
from ..visualization_markers import VisualizationMarkersCfg | ||
## | ||
# Sensors. | ||
## | ||
|
||
FRAME_MARKER_CFG = VisualizationMarkersCfg( | ||
RAY_CASTER_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"frame": VisualizationMarkersCfg.FileMarkerCfg( | ||
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/UIElements/frame_prim.usd", | ||
scale=(0.5, 0.5, 0.5), | ||
) | ||
"hit": sim_utils.SphereCfg( | ||
radius=0.02, | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0)), | ||
), | ||
} | ||
) | ||
"""Configuration for the frame marker.""" | ||
"""Configuration for the ray-caster marker.""" | ||
|
||
POSITION_GOAL_MARKER_CFG = VisualizationMarkersCfg( | ||
|
||
CONTACT_SENSOR_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"target_far": VisualizationMarkersCfg.MarkerCfg( | ||
prim_type="Sphere", | ||
color=(1.0, 0.0, 0.0), | ||
attributes={"radius": 0.01}, | ||
"contact": sim_utils.SphereCfg( | ||
radius=0.02, | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0)), | ||
), | ||
"target_near": VisualizationMarkersCfg.MarkerCfg( | ||
prim_type="Sphere", | ||
color=(0.0, 1.0, 0.0), | ||
attributes={"radius": 0.01}, | ||
), | ||
"target_invisible": VisualizationMarkersCfg.MarkerCfg( | ||
prim_type="Sphere", | ||
color=(0.0, 0.0, 1.0), | ||
attributes={"radius": 0.01}, | ||
"no_contact": sim_utils.SphereCfg( | ||
radius=0.02, | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 1.0, 0.0)), | ||
visible=False, | ||
), | ||
} | ||
}, | ||
) | ||
"""Configuration for the end-effector tracking marker.""" | ||
"""Configuration for the contact sensor marker.""" | ||
|
||
RAY_CASTER_MARKER_CFG = VisualizationMarkersCfg( | ||
|
||
## | ||
# Frames. | ||
## | ||
|
||
FRAME_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"hit": VisualizationMarkersCfg.MarkerCfg( | ||
prim_type="Sphere", | ||
color=(1.0, 0.0, 0.0), | ||
attributes={"radius": 0.02}, | ||
), | ||
}, | ||
"frame": sim_utils.UsdFileCfg( | ||
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/UIElements/frame_prim.usd", | ||
scale=(0.5, 0.5, 0.5), | ||
) | ||
} | ||
) | ||
"""Configuration for the ray-caster marker.""" | ||
"""Configuration for the frame marker.""" | ||
|
||
|
||
CONTACT_SENSOR_MARKER_CFG = VisualizationMarkersCfg( | ||
RED_ARROW_X_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"contact": VisualizationMarkersCfg.MarkerCfg( | ||
prim_type="Sphere", | ||
color=(1.0, 0.0, 0.0), | ||
attributes={"radius": 0.02}, | ||
), | ||
"no_contact": VisualizationMarkersCfg.MarkerCfg( | ||
visible=False, | ||
prim_type="Sphere", | ||
color=(0.0, 1.0, 0.0), | ||
attributes={"radius": 0.02}, | ||
), | ||
}, | ||
"arrow": sim_utils.UsdFileCfg( | ||
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/UIElements/arrow_x.usd", | ||
scale=(1.0, 0.1, 0.1), | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0)), | ||
) | ||
} | ||
) | ||
"""Configuration for the contact sensor marker.""" | ||
"""Configuration for the red arrow marker (along x-direction).""" | ||
|
||
|
||
ARROW_X_MARKER_CFG = VisualizationMarkersCfg( | ||
BLUE_ARROW_X_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"arrow": VisualizationMarkersCfg.FileMarkerCfg( | ||
"arrow": sim_utils.UsdFileCfg( | ||
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/UIElements/arrow_x.usd", | ||
scale=[1.0, 0.1, 0.1], | ||
scale=(1.0, 0.1, 0.1), | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 0.0, 1.0)), | ||
) | ||
} | ||
) | ||
"""Configuration for the arrow marker (along x-direction).""" | ||
"""Configuration for the blue arrow marker (along x-direction).""" | ||
|
||
CUBOID_MARKER_CFG = VisualizationMarkersCfg( | ||
GREEN_ARROW_X_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"cuboid": VisualizationMarkersCfg.MarkerCfg( | ||
prim_type="Cube", | ||
"arrow": sim_utils.UsdFileCfg( | ||
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/UIElements/arrow_x.usd", | ||
scale=(1.0, 0.1, 0.1), | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 1.0, 0.0)), | ||
) | ||
} | ||
) | ||
"""Configuration for the green arrow marker (along x-direction).""" | ||
|
||
|
||
## | ||
# Goals. | ||
## | ||
|
||
CUBOID_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"cuboid": sim_utils.CuboidCfg( | ||
size=(0.1, 0.1, 0.1), | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0)), | ||
), | ||
} | ||
) | ||
"""Configuration for the cuboid marker.""" | ||
|
||
POSITION_GOAL_MARKER_CFG = VisualizationMarkersCfg( | ||
markers={ | ||
"target_far": sim_utils.SphereCfg( | ||
radius=0.01, | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0)), | ||
), | ||
"target_near": sim_utils.SphereCfg( | ||
radius=0.01, | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 1.0, 0.0)), | ||
), | ||
"target_invisible": sim_utils.SphereCfg( | ||
radius=0.01, | ||
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 0.0, 1.0)), | ||
visible=False, | ||
), | ||
} | ||
) | ||
"""Configuration for the end-effector tracking marker.""" |
Oops, something went wrong.