Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer Class Reference
Inheritance diagram for pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, model=pin.Model(), collision_model=None, visual_model=None, copy_models=False, data=None, collision_data=None, visual_data=None)
 
def addGeometryObject (self, pin.GeometryObject obj, color=None)
 
def captureImage (self, w=None, h=None)
 
def clean (self)
 
def delete (self, geometry_object, geometry_type)
 
def disableCameraControl (self)
 
def display (self, q=None)
 
def displayCollisions (self, visibility)
 
def displayFrames (self, visibility, frame_ids=None, axis_length=0.2, axis_width=2)
 
def displayVisuals (self, visibility)
 
def drawFrameVelocities (self, int frame_id, v_scale=0.2, color=FRAME_VEL_COLOR)
 
def enableCameraControl (self)
 
def getViewerNodeName (self, geometry_object, geometry_type)
 
def initializeFrames (self, frame_ids=None, axis_length=0.2, axis_width=2)
 
def initViewer (self, viewer=None, open=False, loadModel=False, zmq_url=None)
 
def loadMeshFromFile (self, geometry_object)
 
def loadPrimitive (self, pin.GeometryObject geometry_object)
 
def loadViewerGeometryObject (self, geometry_object, geometry_type, color=None)
 
def loadViewerModel (self, rootNodeName="pinocchio", color=None, collision_color=None, visual_color=None)
 
def reload (self, new_geometry_object, geometry_type=None)
 
def reset (self)
 
def setBackgroundColor (self, str preset_name="gray", col_top=None, col_bot=None)
 
def setCameraPose (self, pose)
 
def setCameraPosition (self, np.ndarray position)
 
def setCameraPreset (self, str preset_key)
 
def setCameraTarget (self, np.ndarray target)
 
def setCameraZoom (self, float zoom)
 
def updateFrames (self)
 
def updatePlacements (self, geometry_type)
 

Public Attributes

 display_collisions
 
 display_frames
 
 display_visuals
 
 frame_ids
 
 static_objects
 
 viewer
 
 viewerCollisionGroupName
 
 viewerFramesGroupName
 
 viewerRootNodeName
 
 viewerVisualGroupName
 

Static Public Attributes

 ClassVar
 
float FORCE_SCALE = 0.06
 
int FRAME_VEL_COLOR = 0x00FF00
 

Private Member Functions

def _check_meshcat_has_get_image (self)
 
def _draw_vectors_from_frame (self, List[np.ndarray] vecs, List[int] frame_ids, List[str] vec_names, List[int] colors)
 

Private Attributes

 _node_background
 
 _node_default_cam
 
 _rot_cam_key
 

Detailed Description

A Pinocchio display using Meshcat

Definition at line 576 of file meshcat_visualizer.py.

Constructor & Destructor Documentation

◆ __init__()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.__init__ (   self,
  model = pin.Model(),
  collision_model = None,
  visual_model = None,
  copy_models = False,
  data = None,
  collision_data = None,
  visual_data = None 
)

Definition at line 598 of file meshcat_visualizer.py.

Member Function Documentation

◆ _check_meshcat_has_get_image()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._check_meshcat_has_get_image (   self)
private

Definition at line 1023 of file meshcat_visualizer.py.

◆ _draw_vectors_from_frame()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._draw_vectors_from_frame (   self,
List[np.ndarray]  vecs,
List[int]  frame_ids,
List[str vec_names,
List[int]  colors 
)
private
Draw vectors extending from given frames.

Definition at line 1113 of file meshcat_visualizer.py.

◆ addGeometryObject()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.addGeometryObject (   self,
pin.GeometryObject  obj,
  color = None 
)
Add a visual GeometryObject to the viewer, with an optional color.

Definition at line 1018 of file meshcat_visualizer.py.

◆ captureImage()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.captureImage (   self,
  w = None,
  h = None 
)
Capture an image from the Meshcat viewer and return an RGB array.

Definition at line 1030 of file meshcat_visualizer.py.

◆ clean()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.clean (   self)

Definition at line 959 of file meshcat_visualizer.py.

◆ delete()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.delete (   self,
  geometry_object,
  geometry_type 
)

Definition at line 962 of file meshcat_visualizer.py.

◆ disableCameraControl()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.disableCameraControl (   self)

Definition at line 698 of file meshcat_visualizer.py.

◆ display()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.display (   self,
  q = None 
)
Display the robot at configuration q in the viewer by placing all the bodies

Definition at line 966 of file meshcat_visualizer.py.

◆ displayCollisions()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.displayCollisions (   self,
  visibility 
)
Set whether to display collision objects or not.

Definition at line 1040 of file meshcat_visualizer.py.

◆ displayFrames()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.displayFrames (   self,
  visibility,
  frame_ids = None,
  axis_length = 0.2,
  axis_width = 2 
)
Set whether to display frames or not.

Definition at line 1062 of file meshcat_visualizer.py.

◆ displayVisuals()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.displayVisuals (   self,
  visibility 
)
Set whether to display visual objects or not.

Definition at line 1051 of file meshcat_visualizer.py.

◆ drawFrameVelocities()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.drawFrameVelocities (   self,
int  frame_id,
  v_scale = 0.2,
  color = FRAME_VEL_COLOR 
)

Definition at line 1103 of file meshcat_visualizer.py.

◆ enableCameraControl()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.enableCameraControl (   self)

Definition at line 701 of file meshcat_visualizer.py.

◆ getViewerNodeName()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.getViewerNodeName (   self,
  geometry_object,
  geometry_type 
)
Return the name of the geometry object inside the viewer.

Definition at line 627 of file meshcat_visualizer.py.

◆ initializeFrames()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.initializeFrames (   self,
  frame_ids = None,
  axis_length = 0.2,
  axis_width = 2 
)
Initializes the frame objects for display.

Definition at line 1069 of file meshcat_visualizer.py.

◆ initViewer()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.initViewer (   self,
  viewer = None,
  open = False,
  loadModel = False,
  zmq_url = None 
)
Start a new MeshCat server and client.
Note: the server can also be started separately using the "meshcat-server"
command in a terminal:
this enables the server to remain active after the current script ends.

Definition at line 634 of file meshcat_visualizer.py.

◆ loadMeshFromFile()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.loadMeshFromFile (   self,
  geometry_object 
)

Definition at line 775 of file meshcat_visualizer.py.

◆ loadPrimitive()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.loadPrimitive (   self,
pin.GeometryObject  geometry_object 
)

Definition at line 704 of file meshcat_visualizer.py.

◆ loadViewerGeometryObject()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.loadViewerGeometryObject (   self,
  geometry_object,
  geometry_type,
  color = None 
)
Load a single geometry object

Definition at line 800 of file meshcat_visualizer.py.

◆ loadViewerModel()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.loadViewerModel (   self,
  rootNodeName = "pinocchio",
  color = None,
  collision_color = None,
  visual_color = None 
)
Load the robot in a MeshCat viewer.
Parameters:
    rootNodeName: name to give to the robot in the viewer
    color: deprecated and optional, color to give to both the collision
and visual models of the robot. This setting overwrites any color
specified in the robot description. Format is a list of four
RGBA floating-point numbers (between 0 and 1)
    collision_color: optional, color to give to the collision model of
the robot. Format is a list of four RGBA floating-point numbers
(between 0 and 1)
    visual_color: optional, color to give to the visual model of
the robot. Format is a list of four RGBA floating-point numbers
(between 0 and 1)

Definition at line 887 of file meshcat_visualizer.py.

◆ reload()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.reload (   self,
  new_geometry_object,
  geometry_type = None 
)
Reload a geometry_object given by its name and its type

Definition at line 944 of file meshcat_visualizer.py.

◆ reset()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.reset (   self)

Definition at line 663 of file meshcat_visualizer.py.

◆ setBackgroundColor()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.setBackgroundColor (   self,
str   preset_name = "gray",
  col_top = None,
  col_bot = None 
)
Set the background.

Definition at line 667 of file meshcat_visualizer.py.

◆ setCameraPose()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.setCameraPose (   self,
  pose 
)

Definition at line 695 of file meshcat_visualizer.py.

◆ setCameraPosition()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.setCameraPosition (   self,
np.ndarray  position 
)

Definition at line 681 of file meshcat_visualizer.py.

◆ setCameraPreset()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.setCameraPreset (   self,
str  preset_key 
)
Set the camera angle and position using a given preset.

Definition at line 684 of file meshcat_visualizer.py.

◆ setCameraTarget()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.setCameraTarget (   self,
np.ndarray  target 
)

Definition at line 678 of file meshcat_visualizer.py.

◆ setCameraZoom()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.setCameraZoom (   self,
float  zoom 
)

Definition at line 691 of file meshcat_visualizer.py.

◆ updateFrames()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.updateFrames (   self)
Updates the frame visualizations with the latest transforms from model data.

Definition at line 1093 of file meshcat_visualizer.py.

◆ updatePlacements()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.updatePlacements (   self,
  geometry_type 
)

Definition at line 982 of file meshcat_visualizer.py.

Member Data Documentation

◆ _node_background

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._node_background
private

Definition at line 644 of file meshcat_visualizer.py.

◆ _node_default_cam

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._node_default_cam
private

Definition at line 643 of file meshcat_visualizer.py.

◆ _rot_cam_key

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._rot_cam_key
private

Definition at line 645 of file meshcat_visualizer.py.

◆ ClassVar

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.ClassVar
static

Definition at line 581 of file meshcat_visualizer.py.

◆ display_collisions

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.display_collisions

Definition at line 1043 of file meshcat_visualizer.py.

◆ display_frames

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.display_frames

Definition at line 1064 of file meshcat_visualizer.py.

◆ display_visuals

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.display_visuals

Definition at line 1054 of file meshcat_visualizer.py.

◆ FORCE_SCALE

float pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.FORCE_SCALE = 0.06
static

Definition at line 579 of file meshcat_visualizer.py.

◆ frame_ids

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.frame_ids

Definition at line 1074 of file meshcat_visualizer.py.

◆ FRAME_VEL_COLOR

int pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.FRAME_VEL_COLOR = 0x00FF00
static

Definition at line 580 of file meshcat_visualizer.py.

◆ static_objects

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.static_objects

Definition at line 616 of file meshcat_visualizer.py.

◆ viewer

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewer

Definition at line 641 of file meshcat_visualizer.py.

◆ viewerCollisionGroupName

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewerCollisionGroupName

Definition at line 916 of file meshcat_visualizer.py.

◆ viewerFramesGroupName

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewerFramesGroupName

Definition at line 935 of file meshcat_visualizer.py.

◆ viewerRootNodeName

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewerRootNodeName

Definition at line 913 of file meshcat_visualizer.py.

◆ viewerVisualGroupName

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewerVisualGroupName

Definition at line 926 of file meshcat_visualizer.py.


The documentation for this class was generated from the following file:


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:16