visualizer

class visualizer.Visualizer(client=None)[source]

Bases: object

Class to help with custom rendering

Parameters:

client (int, optional, default=None) – The client to be used for the visualizer.

class EyeWindow(eye, parent)[source]

Bases: object

Class to handle windows for eye rendering

Parameters:
  • eye (str) – name of the eye

  • parent (int) – The parent class (Visualizer).

MENU_IDS = {'l_eye': [2, 3, 8], 'r_eye': [4, 5, 9]}
POSITIONS = {'l_eye': [320, 560], 'r_eye': [0, 560]}
get_image()[source]
on_close()[source]

Small function to delete the window from the parent class

on_mouse(event)[source]

Small function to ignore mouse events

Parameters:

event (gui.MouseEvent) – Mouse event

save_image(im)[source]

Callback to get images from open3d

Parameters:

im (o3d.geometry.Image) – the image to be saves

saveimages()[source]

Function to save stream of images to file

class MenuCallback(menu_id, parent)[source]

Bases: object

Class to handle menu callbacks.

Initialize the MenuCallback class.

Parameters:
  • menu_id (int) – The id of the menu.

  • parent (pointer to the class of visualizer.Visualizer type) – The parent class (Visualizer).

input_completed(text=None)[source]
save_image(im, mode)[source]

Save the image. It shows FileDialog to find path for image save. It saves it with the current resolution of the window.

Parameters:
  • im (open3d.geometry.Image) – The image to be saved.

  • mode (int) – The mode of the image. 0 for RGB, 1 for depth.

wait_for_dialog_completion()[source]

Help function to keep the gui loop running

find_xyz_rpy(mesh_name, urdf_name='robot')[source]

Find the xyz, rpy and scales values.

Parameters:
  • mesh_name (str) – The name of the mesh.

  • urdf_name (str, optional, default="robot") – The name of the urdf.

Returns:

The xyz, rpy, and scales, link_name

read_info(obj_id)[source]

Read info from PyBullet

Parameters:

obj_id (int) – id of the object; given by pybullet

Returns:

0 for success

Return type:

int

render()[source]

Render all the things

show_first(urdf_name='robot')[source]

Show the first batch of meshes in the visualizer. It loads the meshes and saves the to dict for quicker use later

Parameters:

urdf_name (str, optional, default="robot") – The name of the urdf to be used.

show_mesh()[source]

Function to parse info about meshes from PyBullet