visualization
Functions
|
Helper function to visualize octree geometries on Viser. |
|
Helper function to visualize a sparse joint path in Cartesian space, using interpolation. |
|
Helper function to visualize a joint trajectory in Cartesian space. |
|
Plot a joint trajectory of positions over time. |
|
Draw a Cartesian position trajectory as straight line segments. |
|
Visualize a Cartesian position trace and optional waypoint markers. |
|
Extract Viser-compatible position and wxyz quaternion from an SE(3) matrix. |
Module Contents
- visualization.visualizeOcTree(viz, octree_geometry, prefix)
Helper function to visualize octree geometries on Viser.
- Parameters:
viz (pinocchio.visualize.ViserVisualizer) – The viser visualizer instance.
octree_geometry (pinocchio.GeometryObject) – the octree geometry object
prefix (str | None) – the prefix for geometry name
- Return type:
None
- visualization.visualizePath(viz, scene, path, frame_names, max_step_size, color=(100, 0, 0), name='/path')
Helper function to visualize a sparse joint path in Cartesian space, using interpolation.
- Parameters:
viz (pinocchio.visualize.ViserVisualizer) – The Viser visualizer instance.
scene (roboplan.core.Scene) – The scene instance.
path (roboplan.core.JointPath | None) – The joint path to visualize.
frame_names (list) – The list of frame names to use for forward kinematics.
max_step_size (float) – The maximum step size between joint configurations when interpolating paths.
color (tuple) – The color of the rendered path.
name (str) – The name of the path in Viser.
- Return type:
None
- visualization.visualizeJointTrajectory(viz, scene, traj, frame_names, color=(100, 0, 0), name='/trajectory')
Helper function to visualize a joint trajectory in Cartesian space.
- Parameters:
viz (pinocchio.visualize.ViserVisualizer) – The Viser visualizer instance.
scene (roboplan.core.Scene) – The scene instance.
traj (roboplan.core.JointTrajectory | None) – The joint trajectory to visualize.
frame_names (list) – The list of frame names to use for forward kinematics.
color (tuple) – The color of the rendered trajectory.
name (str) – The name of the trajectory in Viser.
- Return type:
None
- visualization.plotJointTrajectory(trajectory, scene, plot_title='Joint Trajectory')
Plot a joint trajectory of positions over time.
- Parameters:
trajectory (roboplan.core.JointTrajectory) – The trajectory object to visualize.
scene (roboplan.core.Scene) – The Scene object used to get joint information.
plot_title (str) – The title of the plot.
- Returns:
The matplotlib figure object. Use
matplotlib.pyplot.show()to display it.- Return type:
matplotlib.figure.Figure
- visualization.addPositionPolyline(viz, name, positions, color, line_width)
Draw a Cartesian position trajectory as straight line segments.
- Parameters:
viz (pinocchio.visualize.ViserVisualizer) – The Viser visualizer instance.
name (str) – The name of the trace in Viser.
positions (numpy.ndarray) – Array of xyz positions with shape (N, 3).
color (tuple[int, int, int]) – RGB color tuple.
line_width (float) – Width of the rendered line.
- Return type:
None
- visualization.visualizePositionTrace(viz, positions, trace_name, waypoint_root, trace_color, waypoint_color, line_width=5.0, waypoint_radius=0.01, draw_trace=True, draw_waypoints=True, waypoint_stride=1)
Visualize a Cartesian position trace and optional waypoint markers.
- Parameters:
viz (pinocchio.visualize.ViserVisualizer) – The Viser visualizer instance.
positions (numpy.ndarray) – Array of xyz positions with shape (N, 3).
trace_name (str) – Name of the line trace in Viser.
waypoint_root (str) – Root name for waypoint markers in Viser.
trace_color (tuple[int, int, int]) – RGB color tuple for the trace.
waypoint_color (tuple[int, int, int]) – RGB color tuple for waypoint markers.
line_width (float) – Width of the rendered line.
waypoint_radius (float) – Radius of waypoint marker spheres.
draw_trace (bool) – Whether to draw the line trace.
draw_waypoints (bool) – Whether to draw waypoint markers.
waypoint_stride (int) – Draw one waypoint marker every this many positions.
- Return type:
None
- visualization.se3_to_viser_wxyz(transform)
Extract Viser-compatible position and wxyz quaternion from an SE(3) matrix.
- Parameters:
transform (numpy.ndarray) – 4x4 homogeneous transform.
- Returns:
Tuple of
(position, wxyz)as numpy arrays.- Return type:
tuple[numpy.ndarray, numpy.ndarray]