Implementation:Isaac sim IsaacGymEnvs Visualization Common
| Knowledge Sources | |
|---|---|
| Domains | Visualization, Motion_Analysis |
| Last Updated | 2026-02-15 11:00 GMT |
Overview
Visualization_Common provides convenience wrapper functions for visualizing skeleton states and motions using Matplotlib 3D plots, including both static and interactive playback modes.
Description
This module contains high-level visualization functions that bridge the poselib skeleton data structures with the Matplotlib-based 3D plotting system. The functions create Draw3DSkeletonState or Draw3DSkeletonMotion task objects and render them using the Matplotlib3DPlotter backend.
The plot_skeleton_state function renders a single static skeleton pose. plot_skeleton_states iterates through a one-dimensional sequence of skeleton states, updating the plot at each frame (with an optional skip_n parameter to skip frames). plot_skeleton_motion similarly iterates through a SkeletonMotion object, rendering each frame sequentially with optional frame skipping.
The interactive visualization system is built around plot_skeleton_motion_interactive_base, a generator function that creates a keyboard-controlled playback interface. It defines a PlotParams inner class to track playback state (current frame, playing/paused, looping, playback speed, and confirmation). Keyboard bindings provide controls: x toggles play/pause, z/c step backward/forward by one frame, a/d jump by 20 frames, w toggles looping, v/b double/halve playback speed, n quits, and h shows help. plot_skeleton_motion_interactive is a simple wrapper that exhausts the generator. plot_skeleton_motion_interactive_multiple synchronizes multiple interactive generators, allowing side-by-side comparison of different motions with synchronized playback.
Usage
Use these functions for debugging and analyzing skeleton poses and motions during development. The static functions (plot_skeleton_state, plot_skeleton_states, plot_skeleton_motion) are suitable for quick inspection, while the interactive functions provide detailed frame-by-frame examination of motion data with playback controls.
Code Reference
Source Location
- Repository: IsaacGymEnvs
- File: isaacgymenvs/tasks/amp/poselib/poselib/visualization/common.py
- Lines: 1-210
Signature
def plot_skeleton_state(skeleton_state, task_name=""):
"""Visualize a single skeleton state."""
...
def plot_skeleton_states(skeleton_state, skip_n=1, task_name=""):
"""Visualize a sequence of skeleton states along the first dimension."""
...
def plot_skeleton_motion(skeleton_motion, skip_n=1, task_name=""):
"""Visualize a skeleton motion along its first dimension."""
...
def plot_skeleton_motion_interactive_base(skeleton_motion, task_name=""):
"""Generator providing interactive keyboard-controlled motion playback."""
...
def plot_skeleton_motion_interactive(skeleton_motion, task_name=""):
"""Interactive visualization of a skeleton motion with keyboard controls."""
...
def plot_skeleton_motion_interactive_multiple(*callables, sync=True):
"""Synchronize multiple interactive motion visualizations."""
...
Import
from isaacgymenvs.tasks.amp.poselib.poselib.visualization.common import plot_skeleton_state, plot_skeleton_motion_interactive
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| skeleton_state | SkeletonState | Yes | A skeleton state object to visualize (for plot_skeleton_state and plot_skeleton_states) |
| skeleton_motion | SkeletonMotion | Yes | A skeleton motion object to visualize (for plot_skeleton_motion and interactive functions) |
| skip_n | int | No | Number of frames to skip between rendered frames (default: 1, meaning render every frame) |
| task_name | str | No | Optional label displayed in the visualization window title |
| sync | bool | No | Whether to synchronize playback across multiple motions in plot_skeleton_motion_interactive_multiple (default: True) |
Outputs
| Name | Type | Description |
|---|---|---|
| Matplotlib window | visual | A 3D Matplotlib plot window displaying the skeleton visualization |
| PlotParams (generator) | PlotParams | Yielded by plot_skeleton_motion_interactive_base; contains current frame index, playback state, and speed |
Usage Examples
from isaacgymenvs.tasks.amp.poselib.poselib.visualization.common import (
plot_skeleton_state,
plot_skeleton_states,
plot_skeleton_motion,
plot_skeleton_motion_interactive,
plot_skeleton_motion_interactive_base,
plot_skeleton_motion_interactive_multiple,
)
# Visualize a single skeleton pose
plot_skeleton_state(skeleton_state, task_name="T-Pose")
# Visualize a sequence of states, rendering every 5th frame
plot_skeleton_states(skeleton_state_sequence, skip_n=5, task_name="Walk Cycle")
# Visualize a motion non-interactively
plot_skeleton_motion(skeleton_motion, skip_n=2, task_name="Running")
# Interactive visualization with keyboard controls
# Press 'x' to play/pause, 'z'/'c' to step frames, 'n' to quit
plot_skeleton_motion_interactive(skeleton_motion, task_name="Dance")
# Compare two motions side-by-side with synchronized playback
gen1 = plot_skeleton_motion_interactive_base(motion1, "Original")
gen2 = plot_skeleton_motion_interactive_base(motion2, "Retargeted")
plot_skeleton_motion_interactive_multiple(gen1, gen2, sync=True)