Commit d2f4d90a authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[examples] Add gepetto-viewer and meshcat-viewer to automated testing

parent 49d2a9c7
...@@ -38,6 +38,8 @@ IF(BUILD_PYTHON_INTERFACE) ...@@ -38,6 +38,8 @@ IF(BUILD_PYTHON_INTERFACE)
kinematics-derivatives kinematics-derivatives
fd-derivatives fd-derivatives
id-derivatives id-derivatives
gepetto-viewer
meshcat-viewer
robot-wrapper-viewer robot-wrapper-viewer
) )
......
...@@ -9,12 +9,6 @@ import os ...@@ -9,12 +9,6 @@ import os
from pinocchio.visualize import GepettoVisualizer from pinocchio.visualize import GepettoVisualizer
try:
# Python 2
input = raw_input
except NameError:
pass
# Load the URDF model. # Load the URDF model.
# Conversion with str seems to be necessary when executing this file with ipython # Conversion with str seems to be necessary when executing this file with ipython
current_path = str(os.path.dirname(os.path.abspath(__file__))) current_path = str(os.path.dirname(os.path.abspath(__file__)))
...@@ -52,8 +46,6 @@ q0 = np.matrix([ ...@@ -52,8 +46,6 @@ q0 = np.matrix([
]).T ]).T
viz.display(q0) viz.display(q0)
input("Displaying a single robot configuration. Press enter to continue")
# Display another robot. # Display another robot.
viz2 = GepettoVisualizer(model, collision_model, visual_model) viz2 = GepettoVisualizer(model, collision_model, visual_model)
viz2.initViewer(viz.viewer) viz2.initViewer(viz.viewer)
...@@ -61,4 +53,4 @@ viz2.loadViewerModel(rootNodeName = "pinocchio2") ...@@ -61,4 +53,4 @@ viz2.loadViewerModel(rootNodeName = "pinocchio2")
q = q0.copy() q = q0.copy()
q[1] = 1.0 q[1] = 1.0
viz2.display(q) viz2.display(q)
input("Displaying a second robot. Press enter to exit")
...@@ -8,12 +8,6 @@ import numpy as np ...@@ -8,12 +8,6 @@ import numpy as np
import sys import sys
import os import os
try:
# Python 2
input = raw_input
except NameError:
pass
from pinocchio.visualize import MeshcatVisualizer from pinocchio.visualize import MeshcatVisualizer
# Load the URDF model. # Load the URDF model.
...@@ -40,8 +34,6 @@ except ImportError as err: ...@@ -40,8 +34,6 @@ except ImportError as err:
print(err) print(err)
sys.exit(0) sys.exit(0)
input("Press enter to continue")
# Load the robot in the viewer. # Load the robot in the viewer.
# Color is needed here because the Romeo URDF doesn't contain any color, so the default color results in an # Color is needed here because the Romeo URDF doesn't contain any color, so the default color results in an
# invisible robot (alpha value set to 0). # invisible robot (alpha value set to 0).
...@@ -59,8 +51,6 @@ q0 = np.matrix([ ...@@ -59,8 +51,6 @@ q0 = np.matrix([
]).T ]).T
viz.display(q0) viz.display(q0)
input("Displaying a single robot configuration. Press enter to continue")
# Display another robot. # Display another robot.
red_robot_viz = MeshcatVisualizer(model, collision_model, visual_model) red_robot_viz = MeshcatVisualizer(model, collision_model, visual_model)
red_robot_viz.initViewer(viz.viewer) red_robot_viz.initViewer(viz.viewer)
...@@ -68,4 +58,4 @@ red_robot_viz.loadViewerModel(rootNodeName = "red_robot", color = [1.0, 0.0, 0.0 ...@@ -68,4 +58,4 @@ red_robot_viz.loadViewerModel(rootNodeName = "red_robot", color = [1.0, 0.0, 0.0
q = q0.copy() q = q0.copy()
q[1] = 1.0 q[1] = 1.0
red_robot_viz.display(q) red_robot_viz.display(q)
input("Displaying a second robot with color red, semi-transparent. Press enter to exit")
...@@ -9,12 +9,6 @@ from pinocchio.robot_wrapper import RobotWrapper ...@@ -9,12 +9,6 @@ from pinocchio.robot_wrapper import RobotWrapper
from pinocchio.visualize import * from pinocchio.visualize import *
import os import os
try:
# Python 2
input = raw_input
except NameError:
pass
VISUALIZER = None VISUALIZER = None
# VISUALIZER = GepettoVisualizer # VISUALIZER = GepettoVisualizer
# VISUALIZER = MeshcatVisualizer # VISUALIZER = MeshcatVisualizer
...@@ -49,4 +43,3 @@ if VISUALIZER: ...@@ -49,4 +43,3 @@ if VISUALIZER:
robot.loadViewerModel("pinocchio") robot.loadViewerModel("pinocchio")
robot.display(q0) robot.display(q0)
#input("Press enter to exit.")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment