Implementation:Isaac sim IsaacGymEnvs BasePlotter
| Knowledge Sources | |
|---|---|
| Domains | Visualization, Framework |
| Last Updated | 2026-02-15 11:00 GMT |
Overview
BasePlotter, BasePlotterTask, and BasePlotterTasks are the abstract base classes that define the core plotter and plotting task interfaces for the poselib visualization framework.
Description
The BasePlotterTask class serves as an abstract base for all drawable tasks in the visualization system. Each task has a unique task_name and a task_type that identifies which callable should handle it. The class provides a get_scoped_name() method for creating hierarchical name scopes and requires subclasses to implement __iter__() to yield primitive drawing tasks.
BasePlotterTasks is a simple container class that wraps multiple BasePlotterTask instances and provides iteration over all contained tasks by delegating to each task's own iterator via yield from.
BasePlotter is the abstract plotter class that manages a list of task primitives. It accepts a BasePlotterTask on construction, flattens it into primitives via iteration, and stores them internally. The create() method appends new task primitives and delegates to _create_impl(), while update() refreshes all existing primitives via _update_impl(). Both _create_impl() and _update_impl() are abstract and must be implemented by concrete plotter subclasses (such as matplotlib-based plotters).
Usage
Use these classes when building custom visualization backends for the poselib skeleton and motion visualization system. Subclass BasePlotterTask to define new drawable elements with custom data, and subclass BasePlotter to implement rendering logic for a specific graphics library. These base classes are the foundation upon which all concrete plotter tasks (lines, dots, trails, skeletons) are built.
Code Reference
Source Location
- Repository: IsaacGymEnvs
- File: isaacgymenvs/tasks/amp/poselib/poselib/visualization/core.py
- Lines: 36-100
Signature
class BasePlotterTask(object):
_task_name: str
_task_type: str
def __init__(self, task_name: str, task_type: str) -> None: ...
@property
def task_name(self): ...
@property
def task_type(self): ...
def get_scoped_name(self, name): ...
def __iter__(self): ...
class BasePlotterTasks(object):
def __init__(self, tasks) -> None: ...
def __iter__(self): ...
class BasePlotter(object):
_task_primitives: List[BasePlotterTask]
def __init__(self, task: BasePlotterTask) -> None: ...
@property
def task_primitives(self): ...
def create(self, task: BasePlotterTask) -> None: ...
def update(self) -> None: ...
def _update_impl(self, task_list: List[BasePlotterTask]) -> None: ...
def _create_impl(self, task_list: List[BasePlotterTask]) -> None: ...
Import
from isaacgymenvs.tasks.amp.poselib.poselib.visualization.core import BasePlotter, BasePlotterTask
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| task_name | str | Yes | Unique name identifying the plotter task instance |
| task_type | str | Yes | Type identifier used to select the appropriate rendering callable |
| task | BasePlotterTask | Yes | A plotter task passed to BasePlotter constructor or create() method |
| tasks | list | Yes | A list of BasePlotterTask instances for BasePlotterTasks container |
Outputs
| Name | Type | Description |
|---|---|---|
| task_name | str | The unique name of the task (property) |
| task_type | str | The type identifier of the task (property) |
| task_primitives | List[BasePlotterTask] | All flattened primitive tasks managed by the plotter |
| scoped_name | str | A hierarchically scoped name combining task_name and a child name |
Usage Examples
from isaacgymenvs.tasks.amp.poselib.poselib.visualization.core import (
BasePlotter, BasePlotterTask, BasePlotterTasks
)
# Define a custom task by subclassing BasePlotterTask
class MyDrawTask(BasePlotterTask):
def __init__(self, task_name, data):
super().__init__(task_name=task_name, task_type="MyDrawTask")
self._data = data
def __iter__(self):
yield self
# Define a concrete plotter by subclassing BasePlotter
class MyPlotter(BasePlotter):
def _create_impl(self, task_list):
for task in task_list:
print(f"Creating visual for: {task.task_name}")
def _update_impl(self, task_list):
for task in task_list:
print(f"Updating visual for: {task.task_name}")
# Use the plotter with a task
task = MyDrawTask("my_object", data=[1, 2, 3])
plotter = MyPlotter(task)
plotter.update()
# Combine multiple tasks
combined = BasePlotterTasks([task, MyDrawTask("another_object", data=[4, 5, 6])])
for primitive in combined:
print(primitive.task_name)