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 addGeometryObject (self, 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 displayVisuals (self, visibility)
 
def drawFrameVelocities (self, frame_id, v_scale=0.2, color=FRAME_VEL_COLOR)
 
def enableCameraControl (self)
 
def getViewerNodeName (self, geometry_object, geometry_type)
 
def initViewer (self, viewer=None, open=False, loadModel=False)
 
def loadMesh (self, geometry_object)
 
def loadViewerGeometryObject (self, geometry_object, geometry_type, color=None)
 
def loadViewerModel (self, rootNodeName="pinocchio", color=None)
 
def reload (self, new_geometry_object, geometry_type=None)
 
def setBackgroundColor (self, preset_name="gray")
 
def setCameraPose (self, pose=np.eye(4))
 
def setCameraPosition (self, position)
 
def setCameraPreset (self, preset_key)
 
def setCameraTarget (self, target)
 
def setCameraZoom (self, zoom)
 
def updatePlacements (self, geometry_type)
 

Public Attributes

 display_collisions
 
 display_visuals
 
 static_objects
 
 viewer
 
 viewerCollisionGroupName
 
 viewerRootNodeName
 
 viewerVisualGroupName
 

Static Public Attributes

dictionary CAMERA_PRESETS
 
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, vecs, frame_ids, vec_names, colors)
 

Private Attributes

 _node_background
 
 _node_default_cam
 
 _rot_cam_key
 

Detailed Description

A Pinocchio display using Meshcat

Definition at line 295 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 560 of file meshcat_visualizer.py.

◆ _draw_vectors_from_frame()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._draw_vectors_from_frame (   self,
  vecs,
  frame_ids,
  vec_names,
  colors 
)
private
Draw vectors extending from given frames.

Definition at line 617 of file meshcat_visualizer.py.

◆ addGeometryObject()

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

Definition at line 555 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 567 of file meshcat_visualizer.py.

◆ clean()

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

Definition at line 507 of file meshcat_visualizer.py.

◆ delete()

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

Definition at line 510 of file meshcat_visualizer.py.

◆ disableCameraControl()

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

Definition at line 374 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 514 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 577 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 588 of file meshcat_visualizer.py.

◆ drawFrameVelocities()

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

Definition at line 601 of file meshcat_visualizer.py.

◆ enableCameraControl()

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

Definition at line 377 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 317 of file meshcat_visualizer.py.

◆ initViewer()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.initViewer (   self,
  viewer = None,
  open = False,
  loadModel = False 
)
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 324 of file meshcat_visualizer.py.

◆ loadMesh()

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

Definition at line 380 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 405 of file meshcat_visualizer.py.

◆ loadViewerModel()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.loadViewerModel (   self,
  rootNodeName = "pinocchio",
  color = None 
)
Load the robot in a MeshCat viewer.
Parameters:
    rootNodeName: name to give to the robot in the viewer
    color: optional, color to give to the robot. This overwrites the color present in the urdf.
   Format is a list of four RGBA floats (between 0 and 1)

Definition at line 467 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 492 of file meshcat_visualizer.py.

◆ setBackgroundColor()

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

Definition at line 349 of file meshcat_visualizer.py.

◆ setCameraPose()

def pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.setCameraPose (   self,
  pose = np.eye(4) 
)

Definition at line 371 of file meshcat_visualizer.py.

◆ setCameraPosition()

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

Definition at line 358 of file meshcat_visualizer.py.

◆ setCameraPreset()

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

Definition at line 361 of file meshcat_visualizer.py.

◆ setCameraTarget()

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

Definition at line 355 of file meshcat_visualizer.py.

◆ setCameraZoom()

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

Definition at line 367 of file meshcat_visualizer.py.

◆ updatePlacements()

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

Definition at line 525 of file meshcat_visualizer.py.

Member Data Documentation

◆ _node_background

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._node_background
private

Definition at line 335 of file meshcat_visualizer.py.

◆ _node_default_cam

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._node_default_cam
private

Definition at line 334 of file meshcat_visualizer.py.

◆ _rot_cam_key

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer._rot_cam_key
private

Definition at line 336 of file meshcat_visualizer.py.

◆ CAMERA_PRESETS

dictionary pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.CAMERA_PRESETS
static
Initial value:
= {
"preset0": [
np.zeros(3), # target
[3.0, 0.0, 1.0], # anchor point (x, z, -y) lhs coords
],
"preset1": [np.zeros(3), [1.0, 1.0, 1.0]],
"preset2": [[0.0, 0.0, 0.6], [0.8, 1.0, 1.2]],
"acrobot": [[0.0, 0.1, 0.0], [0.5, 0.0, 0.2]],
"cam_ur": [[0.4, 0.6, -0.2], [1.0, 0.4, 1.2]],
"cam_ur2": [[0.4, 0.3, 0.0], [0.5, 0.1, 1.4]],
"cam_ur3": [[0.4, 0.3, 0.0], [0.6, 1.3, 0.3]],
"cam_ur4": [[-1.0, 0.3, 0.0], [1.3, 0.1, 1.2]], # x>0 to x<0
"cam_ur5": [[-1.0, 0.3, 0.0], [-0.05, 1.5, 1.2]],
"talos": [[0.0, 1.2, 0.0], [1.5, 0.3, 1.5]],
"talos2": [[0.0, 1.1, 0.0], [1.2, 0.6, 1.5]],
}

Definition at line 300 of file meshcat_visualizer.py.

◆ display_collisions

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.display_collisions

Definition at line 580 of file meshcat_visualizer.py.

◆ display_visuals

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.display_visuals

Definition at line 591 of file meshcat_visualizer.py.

◆ FORCE_SCALE

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

Definition at line 298 of file meshcat_visualizer.py.

◆ FRAME_VEL_COLOR

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

Definition at line 299 of file meshcat_visualizer.py.

◆ static_objects

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.static_objects

Definition at line 337 of file meshcat_visualizer.py.

◆ viewer

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewer

Definition at line 332 of file meshcat_visualizer.py.

◆ viewerCollisionGroupName

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewerCollisionGroupName

Definition at line 479 of file meshcat_visualizer.py.

◆ viewerRootNodeName

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewerRootNodeName

Definition at line 476 of file meshcat_visualizer.py.

◆ viewerVisualGroupName

pinocchio.visualize.meshcat_visualizer.MeshcatVisualizer.viewerVisualGroupName

Definition at line 486 of file meshcat_visualizer.py.


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


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:36