icub_pybullet.visualizer

Visualization utils for pyCub simulator

Author:

Lukas Rustler

Classes

Visualizer

Class to help with custom rendering

Module Contents

class icub_pybullet.visualizer.Visualizer(client: pyCub)

Class to help with custom rendering

client
meshes
R_urdf
skin_activated_last_turn
blue
red
gui
window
menu
scene
vis
mattr
mat
file_menu
show_menu
file_dir
orientations = []
positions = []
colors = []
paths = []
eye_windows
default_center
is_alive = True
reset_view() → None

Reset the camera view to the initial look-at pose.

show_first(urdf_name: str | None = 'robot') → None

Load and register initial visual meshes and skin clouds for urdf_name.

show_mesh() → None

Update mesh transforms, eye camera poses, and skin activation colors.

read_info(obj_id: int) → int

Fetch current link poses, colors, and mesh file paths for body obj_id.

render() → None

Synchronize the 3D scene and eye windows with PyBullet and advance one GUI tick.

class MenuCallback(menu_id: int, parent: Visualizer)

Callable handler bound to Open3D Save/Show menu items.

id
parent
path = None
dialog_opened = False
save_image(im: open3d.geometry.Image, mode: int) → None

Prompt for an output path and write an RGB (mode 0) or depth (mode 1) image.

wait_for_dialog_completion() → None

Pump Open3D GUI events until the save-file dialog closes.

input_completed(text: str | None = None)

Store the selected file path and mark the file dialog complete.

find_xyz_rpy(mesh_name: str, urdf_name: str | None = 'robot') → Tuple[list, list, float, str]

Look up visual origin offset, rotation, scale, and link name for mesh_name.

class EyeWindow(eye: str, parent: Visualizer)

Secondary Open3D viewport rendering the view from l_eye or r_eye.

MENU_IDS
POSITIONS
eye
parent
window
scene
vis
center = None
dir = None
img_counter = 0
save_images_bool = False
last_image = None
last_depth_image = None
on_close() → bool

Unregister this eye window and disable its stream menu entries.

on_mouse(event: open3d.visualization.gui.MouseEvent) → int

Consume mouse events so users cannot orbit the fixed eye camera view.

get_image() → None

Capture an asynchronous RGB snapshot from the eye scene.

get_depth_image() → None

Capture an asynchronous depth snapshot from the eye scene.

save_images() → None

Save the latest captured RGB frame to disk and increment the frame counter.

save_image(im: open3d.geometry.Image) → None

Callback storing the latest rendered RGB image.

save_depth_image(im: open3d.geometry.Image) → None

Callback storing the latest rendered depth image.

unproject(u, v, d)

Unproject pixel (u, v) at depth d into 3D world coordinates.