Public Member Functions | Public Attributes | Static Private Attributes | List of all members
pinocchio.visualize.base_visualizer.BaseVisualizer Class Reference
Inheritance diagram for pinocchio.visualize.base_visualizer.BaseVisualizer:
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 captureImage (self, w=None, h=None)
 
def clean (self)
 
def create_video_ctx (self, filename=None, fps=30, directory=None, **kwargs)
 
def disableCameraControl (self)
 
def display (self, q=None)
 
def displayCollisions (self, visibility)
 
def displayVisuals (self, visibility)
 
def drawFrameVelocities (self, *args, **kwargs)
 
def enableCameraControl (self)
 
def getViewerNodeName (self, geometry_object, geometry_type)
 
def has_video_writer (self)
 
def initViewer (self, *args, **kwargs)
 
def loadViewerModel (self, *args, **kwargs)
 
def play (self, q_trajectory, dt=None, callback=None, capture=False, **kwargs)
 
def rebuildData (self)
 
def reload (self, new_geometry_object, geometry_type=None)
 
def setBackgroundColor (self)
 
def setCameraPose (self, np.ndarray pose=np.eye(4))
 
def setCameraPosition (self, np.ndarray position)
 
def setCameraTarget (self, target)
 
def setCameraZoom (self, float zoom)
 
def sleep (self, dt)
 

Public Attributes

 collision_data
 
 collision_model
 
 data
 
 model
 
 visual_data
 
 visual_model
 

Static Private Attributes

 _video_writer = None
 

Detailed Description

Pinocchio visualizers are employed to easily display a model at a given
configuration.
BaseVisualizer is not meant to be directly employed, but only to provide a uniform
interface and a few common methods.
New visualizers should extend this class and override its methods as neeeded.

Definition at line 18 of file base_visualizer.py.

Constructor & Destructor Documentation

◆ __init__()

def pinocchio.visualize.base_visualizer.BaseVisualizer.__init__ (   self,
  model = pin.Model(),
  collision_model = None,
  visual_model = None,
  copy_models = False,
  data = None,
  collision_data = None,
  visual_data = None 
)
Construct a display from the given model, collision model, and visual model.
If copy_models is True, the models are copied. Otherwise, they are simply kept
as a reference.

Definition at line 31 of file base_visualizer.py.

Member Function Documentation

◆ captureImage()

def pinocchio.visualize.base_visualizer.BaseVisualizer.captureImage (   self,
  w = None,
  h = None 
)
Captures an image from the viewer and returns an RGB array.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 135 of file base_visualizer.py.

◆ clean()

def pinocchio.visualize.base_visualizer.BaseVisualizer.clean (   self)
Delete all the objects from the whole scene

Definition at line 94 of file base_visualizer.py.

◆ create_video_ctx()

def pinocchio.visualize.base_visualizer.BaseVisualizer.create_video_ctx (   self,
  filename = None,
  fps = 30,
  directory = None,
**  kwargs 
)
Create a video recording context, generating the output filename if necessary.

Code inspired from https://github.com/petrikvladimir/RoboMeshCat.

Definition at line 184 of file base_visualizer.py.

◆ disableCameraControl()

def pinocchio.visualize.base_visualizer.BaseVisualizer.disableCameraControl (   self)
Disable camera manual control

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 139 of file base_visualizer.py.

◆ display()

def pinocchio.visualize.base_visualizer.BaseVisualizer.display (   self,
  q = None 
)
Display the robot at configuration q or refresh the rendering
from the current placements contained in data by placing all the bodies in the
viewer.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 99 of file base_visualizer.py.

◆ displayCollisions()

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

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 107 of file base_visualizer.py.

◆ displayVisuals()

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

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 111 of file base_visualizer.py.

◆ drawFrameVelocities()

def pinocchio.visualize.base_visualizer.BaseVisualizer.drawFrameVelocities (   self,
args,
**  kwargs 
)
Draw current frame velocities.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 147 of file base_visualizer.py.

◆ enableCameraControl()

def pinocchio.visualize.base_visualizer.BaseVisualizer.enableCameraControl (   self)
Enable camera manual control

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 143 of file base_visualizer.py.

◆ getViewerNodeName()

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

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 78 of file base_visualizer.py.

◆ has_video_writer()

def pinocchio.visualize.base_visualizer.BaseVisualizer.has_video_writer (   self)

Definition at line 153 of file base_visualizer.py.

◆ initViewer()

def pinocchio.visualize.base_visualizer.BaseVisualizer.initViewer (   self,
args,
**  kwargs 
)
Init the viewer by loading the gui and creating a window.

Definition at line 82 of file base_visualizer.py.

◆ loadViewerModel()

def pinocchio.visualize.base_visualizer.BaseVisualizer.loadViewerModel (   self,
args,
**  kwargs 
)
Create the scene displaying the robot meshes in the viewer

Definition at line 86 of file base_visualizer.py.

◆ play()

def pinocchio.visualize.base_visualizer.BaseVisualizer.play (   self,
  q_trajectory,
  dt = None,
  callback = None,
  capture = False,
**  kwargs 
)
Play a trajectory with given time step. Optionally capture RGB images and
returns them.

Definition at line 156 of file base_visualizer.py.

◆ rebuildData()

def pinocchio.visualize.base_visualizer.BaseVisualizer.rebuildData (   self)
Re-build the data objects. Needed if the models were modified.
Warning: this will delete any information stored in all data objects.

Definition at line 71 of file base_visualizer.py.

◆ reload()

def pinocchio.visualize.base_visualizer.BaseVisualizer.reload (   self,
  new_geometry_object,
  geometry_type = None 
)
Reload a geometry_object given by its type

Definition at line 90 of file base_visualizer.py.

◆ setBackgroundColor()

def pinocchio.visualize.base_visualizer.BaseVisualizer.setBackgroundColor (   self)
Set the visualizer background color.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 115 of file base_visualizer.py.

◆ setCameraPose()

def pinocchio.visualize.base_visualizer.BaseVisualizer.setCameraPose (   self,
np.ndarray   pose = np.eye(4) 
)
Set camera 6D pose using a 4x4 matrix.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 131 of file base_visualizer.py.

◆ setCameraPosition()

def pinocchio.visualize.base_visualizer.BaseVisualizer.setCameraPosition (   self,
np.ndarray  position 
)
Set the camera's 3D position.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 123 of file base_visualizer.py.

◆ setCameraTarget()

def pinocchio.visualize.base_visualizer.BaseVisualizer.setCameraTarget (   self,
  target 
)
Set the camera target.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 119 of file base_visualizer.py.

◆ setCameraZoom()

def pinocchio.visualize.base_visualizer.BaseVisualizer.setCameraZoom (   self,
float  zoom 
)
Set camera zoom value.

Reimplemented in pinocchio.visualize.panda3d_visualizer.Panda3dVisualizer.

Definition at line 127 of file base_visualizer.py.

◆ sleep()

def pinocchio.visualize.base_visualizer.BaseVisualizer.sleep (   self,
  dt 
)

Definition at line 150 of file base_visualizer.py.

Member Data Documentation

◆ _video_writer

pinocchio.visualize.base_visualizer.BaseVisualizer._video_writer = None
staticprivate

Definition at line 27 of file base_visualizer.py.

◆ collision_data

pinocchio.visualize.base_visualizer.BaseVisualizer.collision_data

Definition at line 53 of file base_visualizer.py.

◆ collision_model

pinocchio.visualize.base_visualizer.BaseVisualizer.collision_model

Definition at line 40 of file base_visualizer.py.

◆ data

pinocchio.visualize.base_visualizer.BaseVisualizer.data

Definition at line 48 of file base_visualizer.py.

◆ model

pinocchio.visualize.base_visualizer.BaseVisualizer.model

Definition at line 39 of file base_visualizer.py.

◆ visual_data

pinocchio.visualize.base_visualizer.BaseVisualizer.visual_data

Definition at line 58 of file base_visualizer.py.

◆ visual_model

pinocchio.visualize.base_visualizer.BaseVisualizer.visual_model

Definition at line 41 of file base_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