panda3d-viewer.py
Go to the documentation of this file.
1 # This examples shows how to load several robots in panda3d_viewer.
2 # Note: this feature requires panda3d_viewer to be installed, this can be done using
3 # pip install --user panda3d_viewer
4 
5 import pinocchio as pin
6 import sys
7 
8 from os.path import dirname, join, abspath
9 
10 # add path to the example-robot-data package
11 path = join(dirname(dirname(abspath(__file__))), 'models', 'example-robot-data', 'python')
12 sys.path.append(path)
13 from example_robot_data import loadTalos, loadRomeo, loadICub, loadTiago
14 from example_robot_data import loadSolo, loadHyQ, loadHector
15 
16 # import visualizer
17 from panda3d_viewer import Viewer
18 from pinocchio.visualize.panda3d_visualizer import Panda3dVisualizer
19 
20 # open a GUI window
21 viewer = Viewer(window_title='python-pinocchio')
22 
23 loaders = (loadTalos, loadRomeo, loadICub, loadTiago, loadSolo, loadHyQ,
24  loadHector)
25 
26 for i, load in enumerate(loaders):
27  robot = load()
28  robot.setVisualizer(Panda3dVisualizer())
29  robot.initViewer(viewer=viewer) # attach to a viewer's scene
30  robot.loadViewerModel(group_name=robot.model.name)
31 
32  q = robot.q0[:]
33  q[1] = 3 - i
34  if load is loadRomeo:
35  q[2] = 0.87
36 
37  robot.display(q)
38 
39 viewer.join()
def load(name, display=False, rootNodeName="")


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