Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
d2f4d90a
Commit
d2f4d90a
authored
Nov 28, 2019
by
Gabriele Buondonno
Browse files
[examples] Add gepetto-viewer and meshcat-viewer to automated testing
parent
49d2a9c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/CMakeLists.txt
View file @
d2f4d90a
...
...
@@ -38,6 +38,8 @@ IF(BUILD_PYTHON_INTERFACE)
kinematics-derivatives
fd-derivatives
id-derivatives
gepetto-viewer
meshcat-viewer
robot-wrapper-viewer
)
...
...
examples/gepetto-viewer.py
View file @
d2f4d90a
...
...
@@ -9,12 +9,6 @@ import os
from
pinocchio.visualize
import
GepettoVisualizer
try
:
# Python 2
input
=
raw_input
except
NameError
:
pass
# Load the URDF model.
# Conversion with str seems to be necessary when executing this file with ipython
current_path
=
str
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
...
...
@@ -52,8 +46,6 @@ q0 = np.matrix([
]).
T
viz
.
display
(
q0
)
input
(
"Displaying a single robot configuration. Press enter to continue"
)
# Display another robot.
viz2
=
GepettoVisualizer
(
model
,
collision_model
,
visual_model
)
viz2
.
initViewer
(
viz
.
viewer
)
...
...
@@ -61,4 +53,4 @@ viz2.loadViewerModel(rootNodeName = "pinocchio2")
q
=
q0
.
copy
()
q
[
1
]
=
1.0
viz2
.
display
(
q
)
input
(
"Displaying a second robot. Press enter to exit"
)
examples/meshcat-viewer.py
View file @
d2f4d90a
...
...
@@ -8,12 +8,6 @@ import numpy as np
import
sys
import
os
try
:
# Python 2
input
=
raw_input
except
NameError
:
pass
from
pinocchio.visualize
import
MeshcatVisualizer
# Load the URDF model.
...
...
@@ -40,8 +34,6 @@ except ImportError as err:
print
(
err
)
sys
.
exit
(
0
)
input
(
"Press enter to continue"
)
# 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
# invisible robot (alpha value set to 0).
...
...
@@ -59,8 +51,6 @@ q0 = np.matrix([
]).
T
viz
.
display
(
q0
)
input
(
"Displaying a single robot configuration. Press enter to continue"
)
# Display another robot.
red_robot_viz
=
MeshcatVisualizer
(
model
,
collision_model
,
visual_model
)
red_robot_viz
.
initViewer
(
viz
.
viewer
)
...
...
@@ -68,4 +58,4 @@ red_robot_viz.loadViewerModel(rootNodeName = "red_robot", color = [1.0, 0.0, 0.0
q
=
q0
.
copy
()
q
[
1
]
=
1.0
red_robot_viz
.
display
(
q
)
input
(
"Displaying a second robot with color red, semi-transparent. Press enter to exit"
)
examples/robot-wrapper-viewer.py
View file @
d2f4d90a
...
...
@@ -9,12 +9,6 @@ from pinocchio.robot_wrapper import RobotWrapper
from
pinocchio.visualize
import
*
import
os
try
:
# Python 2
input
=
raw_input
except
NameError
:
pass
VISUALIZER
=
None
# VISUALIZER = GepettoVisualizer
# VISUALIZER = MeshcatVisualizer
...
...
@@ -49,4 +43,3 @@ if VISUALIZER:
robot
.
loadViewerModel
(
"pinocchio"
)
robot
.
display
(
q0
)
#input("Press enter to exit.")
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment