visualization

Visualzation class

Author:

Lukas Rustler

class pybullet_grasper.visualization.Visualizer(client: Any | None = None, visible: int = 0)[source]

Bases: object

Class to help with custom rendering

Initializes Open3D-based visualization utilities.

Parameters:
  • client (Any, optional, default=None) – active simulation client used to query geometry states

  • visible (int, optional, default=0) – 1 to show UI window, 0 for headless render loop

Returns:

None

Return type:

None

class KeyCallback(geom_type: str, parent: Any, menu_id: int)[source]

Bases: object

Help function to unify key callbacks for toggling thingies in the windows

Init :param geom_type: name of geometric type: cone, object, gripper :type geom_type: str :param parent: pointer to the parent instance :type parent: Any :param menu_id: menu item identifier in Open3D menu :type menu_id: int :return: None :rtype: None

class OnCloseGWS(gws_type: str, parent: Visualizer)[source]

Bases: object

Help class delete information about the given GWS window from visualizer

Init :param gws_type: type of GWS, by default something like L1_fixed_force; used as key to dictionary :type gws_type: str :param parent: pointer to parent instance :type parent: Visualizer :return: None :rtype: None

draw_force_torques(points: ndarray, forces: ndarray, torques: ndarray, cone_vertices: int, magnitudes: ndarray, world_origin: List[float] | ndarray = [0, 0, 0]) None[source]

Draws friction cones and torque vectors for currently active contacts.

Parameters:
  • points (np.ndarray) – contact point positions

  • forces (np.ndarray) – discretized friction cone forces

  • torques (np.ndarray) – corresponding torques for plotted forces

  • cone_vertices (int) – number of vertices per friction cone approximation

  • magnitudes (np.ndarray) – normal force magnitudes used for cone scaling

  • world_origin (list[float] | np.ndarray, optional, default=[0, 0, 0]) – origin offset applied to rendered vectors

Returns:

None

Return type:

None

draw_gws() None[source]

Opens per-hull windows with grasp wrench space meshes.

Returns:

None

Return type:

None

draw_normal_forces(points: ndarray, normals: ndarray, world_origin: List[float] | ndarray = [0, 0, 0]) None[source]

Draws line segments for contact normals.

Parameters:
  • points (np.ndarray) – contact point positions

  • normals (np.ndarray) – normal vectors at contact points

  • world_origin (list[float] | np.ndarray, optional, default=[0, 0, 0]) – origin offset applied to rendered vectors

Returns:

None

Return type:

None

render() None[source]

Interactive render :return: None :rtype: None

save_image(im: Any) None[source]

Stores the last rendered image from asynchronous Open3D callback.

Parameters:

im (Any) – rendered image instance provided by Open3D

Returns:

None

Return type:

None

show_mesh(obj_type: str = '') None[source]

Function to parse message with information to insert objects to window :param obj_type: which type of objects is being shown - gripper, object :type obj_type: str, optional, default=”” :return: None :rtype: None