diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py index f8723c1daf..48222937fc 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py @@ -256,9 +256,12 @@ def has_debug_vis_implementation(self) -> bool: def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequence[float]]]: """Returns the active terms as iterable sequence of tuples. + The first element of the tuple is the name of the term and the second element is the raw value(s) of the term. + Args: env_idx: The specific environment to pull the active terms from. + Returns: The active terms. """ @@ -270,7 +273,7 @@ def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequenc idx += term.action_dim return terms - def set_debug_vis(self, debug_vis: bool) -> bool: + def set_debug_vis(self, debug_vis: bool): """Sets whether to visualize the action data. Args: debug_vis: Whether to visualize the action data. diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/command_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/command_manager.py index cfc546edc8..af0a9b4737 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/command_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/command_manager.py @@ -293,9 +293,12 @@ def has_debug_vis_implementation(self) -> bool: def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequence[float]]]: """Returns the active terms as iterable sequence of tuples. + The first element of the tuple is the name of the term and the second element is the raw value(s) of the term. + Args: env_idx: The specific environment to pull the active terms from. + Returns: The active terms. """ @@ -303,12 +306,11 @@ def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequenc terms = [] idx = 0 for name, term in self._terms.items(): - term_commands = self._commands[env_idx, idx : idx + term.command.shape[1]].cpu() - terms.append((name, term_commands.tolist())) + terms.append((name, term.command[env_idx].cpu().tolist())) idx += term.command.shape[1] return terms - def set_debug_vis(self, debug_vis: bool) -> bool: + def set_debug_vis(self, debug_vis: bool): """Sets whether to visualize the command data. Args: diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/curriculum_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/curriculum_manager.py index c794e14209..a6a28462c1 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/curriculum_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/curriculum_manager.py @@ -133,9 +133,12 @@ def compute(self, env_ids: Sequence[int] | None = None): def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequence[float]]]: """Returns the active terms as iterable sequence of tuples. + The first element of the tuple is the name of the term and the second element is the raw value(s) of the term. + Args: env_idx: The specific environment to pull the active terms from. + Returns: The active terms. """ diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/manager_base.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/manager_base.py index 34906ff431..f0f4a3ba8e 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/manager_base.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/manager_base.py @@ -194,7 +194,9 @@ def find_terms(self, name_keys: str | Sequence[str]) -> list[str]: def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequence[float]]]: """Returns the active terms as iterable sequence of tuples. + The first element of the tuple is the name of the term and the second element is the raw value(s) of the term. + Returns: The active terms. """ diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/observation_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/observation_manager.py index 9c51f8c9ad..329e87ab2a 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/observation_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/observation_manager.py @@ -123,9 +123,12 @@ def __str__(self) -> str: def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequence[float]]]: """Returns the active terms as iterable sequence of tuples. + The first element of the tuple is the name of the term and the second element is the raw value(s) of the term. + Args: env_idx: The specific environment to pull the active terms from. + Returns: The active terms. """ diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/reward_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/reward_manager.py index dcb3ccadde..1d5ac62e81 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/reward_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/reward_manager.py @@ -188,9 +188,12 @@ def get_term_cfg(self, term_name: str) -> RewardTermCfg: def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequence[float]]]: """Returns the active terms as iterable sequence of tuples. + The first element of the tuple is the name of the term and the second element is the raw value(s) of the term. + Args: env_idx: The specific environment to pull the active terms from. + Returns: The active terms. """ diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/termination_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/termination_manager.py index 357e6eb542..f0b66b3676 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/termination_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/termination_manager.py @@ -180,9 +180,12 @@ def get_term(self, name: str) -> torch.Tensor: def get_active_iterable_terms(self, env_idx: int) -> Sequence[tuple[str, Sequence[float]]]: """Returns the active terms as iterable sequence of tuples. + The first element of the tuple is the name of the term and the second element is the raw value(s) of the term. + Args: env_idx: The specific environment to pull the active terms from. + Returns: The active terms. """ diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/ui/widgets/manager_live_visualizer.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/ui/widgets/manager_live_visualizer.py index 170dc55d6d..650d423113 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/ui/widgets/manager_live_visualizer.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/ui/widgets/manager_live_visualizer.py @@ -15,7 +15,9 @@ from omni.ui import CollapsableFrame, Frame, VStack, Window from omni.isaac.lab.managers import ManagerBase -from omni.isaac.lab.ui.widgets import ImagePlot, LiveLinePlot, UiVisualizerBase +from .image_plot import ImagePlot +from .line_plot import LiveLinePlot +from .ui_visualizer_base import UiVisualizerBase from omni.isaac.lab.utils import configclass @@ -205,7 +207,7 @@ def _set_debug_vis_impl(self, debug_vis: bool) -> None: ) with frame: # create line plot for single or multivariable signals - if len(term) <= 2: + if isinstance(term[0], float | int): plot = LiveLinePlot( y_data=[[elem] for elem in term], plot_height=150, @@ -213,12 +215,17 @@ def _set_debug_vis_impl(self, debug_vis: bool) -> None: ) self._term_visualizers.append(plot) # create an image plot for 2d and greater data (i.e. mono and rgb images) - elif len(term) > 2: + elif isinstance(term[0], list) and isinstance(term[0][0], float | int): image = ImagePlot( image=numpy.array(term), label=name, ) self._term_visualizers.append(image) + else: + carb.log_warn( + f"ManagerLiveVisualizer: Term ({name}) is not a supported data type for" + " visualization." + ) frame.collapsed = True self._debug_vis = debug_vis