Implementation:Isaac sim IsaacGymEnvs SkeletonPlotterTasks
| Knowledge Sources | |
|---|---|
| Domains | Visualization, Skeleton_Animation |
| Last Updated | 2026-02-15 11:00 GMT |
Overview
SkeletonPlotterTasks defines composite visualization tasks for rendering 3D skeleton states, skeleton motions with velocity indicators and trails, and collections of multiple skeleton motions.
Description
The Draw3DSkeletonState class renders a single skeleton pose by decomposing it into two primitive sub-tasks: Draw3DLines for the bones (connecting parent-child joint pairs) and Draw3DDots for the joint positions. It extracts global translations from a SkeletonState object and traverses the skeleton tree's parent indices to construct line segments between each joint and its parent. The update() method accepts a new skeleton state and refreshes both the line and dot data.
The Draw3DSkeletonMotion class builds upon Draw3DSkeletonState to visualize animated skeleton motion. In addition to the skeleton pose, it renders velocity vectors and angular velocity vectors as Draw3DLines (scaled by 0.02 and 0.01 respectively for visual clarity), and a center-of-mass trail using Draw3DTrail. The trail maintains a rolling buffer of recent root positions with a configurable trail_length. The update() method supports advancing to a specific frame index, optionally resetting the trail, and replacing the entire skeleton motion data.
The Draw3DSkeletonMotions class is a container that wraps multiple Draw3DSkeletonMotion instances and synchronizes their updates to the same frame index, enabling side-by-side comparison of multiple motion sequences.
Usage
Use Draw3DSkeletonState when you need to visualize a single static skeleton pose. Use Draw3DSkeletonMotion for interactive playback of motion clips with velocity and trail indicators. Use Draw3DSkeletonMotions when comparing multiple motion sequences simultaneously. These tasks are the primary visualization tools used during motion retargeting, AMP reference motion inspection, and debugging of skeleton-based reinforcement learning environments.
Code Reference
Source Location
- Repository: IsaacGymEnvs
- File: isaacgymenvs/tasks/amp/poselib/poselib/visualization/skeleton_plotter_tasks.py
- Lines: 40-217
Signature
class Draw3DSkeletonState(BasePlotterTask):
def __init__(self, task_name: str, skeleton_state,
joints_color: str = "red", lines_color: str = "blue",
alpha: float = 1.0) -> None: ...
def update(self, skeleton_state) -> None: ...
@staticmethod
def _get_lines_and_dots(skeleton_state): ...
class Draw3DSkeletonMotion(BasePlotterTask):
def __init__(self, task_name: str, skeleton_motion,
frame_index=None, joints_color="red", lines_color="blue",
velocity_color="green", angular_velocity_color="purple",
trail_color="black", trail_length=10, alpha=1.0) -> None: ...
def update(self, frame_index=None, reset_trail=False,
skeleton_motion=None) -> None: ...
@staticmethod
def _get_vel_and_avel(skeleton_motion): ...
class Draw3DSkeletonMotions(BasePlotterTask):
def __init__(self, skeleton_motion_tasks) -> None: ...
def update(self, frame_index) -> None: ...
Import
from isaacgymenvs.tasks.amp.poselib.poselib.visualization.skeleton_plotter_tasks import Draw3DSkeletonState, Draw3DSkeletonMotion
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| task_name | str | Yes | Unique identifier for the skeleton drawing task |
| skeleton_state | SkeletonState | Yes (for Draw3DSkeletonState) | A poselib SkeletonState with global translations and skeleton tree |
| skeleton_motion | SkeletonMotion | Yes (for Draw3DSkeletonMotion) | A poselib SkeletonMotion containing frames of skeleton states with velocities |
| frame_index | int | No | Specific frame to display from the motion (default: None uses full tensor) |
| joints_color | str | No | Color for joint dots (default: "red") |
| lines_color | str | No | Color for bone lines (default: "blue") |
| velocity_color | str | No | Color for velocity vectors (default: "green") |
| angular_velocity_color | str | No | Color for angular velocity vectors (default: "purple") |
| trail_color | str | No | Color for center-of-mass trail (default: "black") |
| trail_length | int | No | Number of historical positions in the trail buffer (default: 10) |
| alpha | float | No | Transparency value from 0.0 to 1.0 (default: 1.0) |
| reset_trail | bool | No | Whether to reset the trail on update (default: False) |
Outputs
| Name | Type | Description |
|---|---|---|
| lines_task | Draw3DLines | Sub-task rendering bone line segments between parent-child joints |
| dots_task | Draw3DDots | Sub-task rendering joint position markers |
| vel_task | Draw3DLines | Sub-task rendering velocity vectors at each joint (Draw3DSkeletonMotion only) |
| avel_task | Draw3DLines | Sub-task rendering angular velocity vectors at each joint (Draw3DSkeletonMotion only) |
| com_trail_task | Draw3DTrail | Sub-task rendering center-of-mass motion trail (Draw3DSkeletonMotion only) |
Usage Examples
from isaacgymenvs.tasks.amp.poselib.poselib.visualization.skeleton_plotter_tasks import (
Draw3DSkeletonState, Draw3DSkeletonMotion, Draw3DSkeletonMotions
)
from poselib.skeleton.skeleton3d import SkeletonState, SkeletonMotion
# Visualize a single skeleton state (T-pose)
tpose = SkeletonState.from_file("data/amp_humanoid_tpose.npy")
state_task = Draw3DSkeletonState(
"humanoid_tpose", tpose,
joints_color="red", lines_color="blue"
)
# Visualize animated skeleton motion with velocity indicators
motion = SkeletonMotion.from_file("data/amp_humanoid_walk.npy")
motion_task = Draw3DSkeletonMotion(
"humanoid_walk", motion,
frame_index=0,
trail_length=20,
velocity_color="green"
)
# Advance to next frame
motion_task.update(frame_index=1)
# Reset trail when restarting playback
motion_task.update(frame_index=0, reset_trail=True)
# Iterate over primitive sub-tasks for rendering
for primitive in motion_task:
print(primitive.task_name, primitive.task_type)