meshcat-dev / meshcat-python

WebGL-based 3D visualizer for Python
MIT License
256 stars 63 forks source link

Silent problem when loading or displaying DAE files #84

Open nmansard opened 3 years ago

nmansard commented 3 years ago

Hi all. Thanks again for the contribution you are bringing with MeshCat. I have a problem when loading some DAE files, for example the forearm of the UR5 as available here: https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/upperarm.dae The DAE seems to be properly parsed, and no warning or error is displayed. Yet it does not show in the viewer. Trying the same code on the corresponding STL file (for example obtained by converting it with osgconv) works like a charm.

Am I doing something incorrect? If not, would you have some directions for me to investigate the problem?

Thanks in advance.

import meshcat
viz=meshcat.Visualizer()
viz.open()

# I used the DAE packaged in APT (deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub bionic robotpkg)  robotpkg-py36-example-robot-data
# Change the path if you are using the url above to obtain it.
dae=meshcat.geometry.DaeMeshGeometry.from_file('/opt/openrobots/share/example-robot-data/robots/ur_description/meshes/ur5/visual/upperarm.dae')
material = meshcat.geometry.MeshPhongMaterial()
material.color = 255
material.transparent=False
viz['upperarm'].set_object(dae,material)
danzimmerman commented 3 years ago

Are you still having trouble?

I'm having different problems with .dae files, as described here:

https://github.com/stack-of-tasks/pinocchio/issues/1475

I haven't had any problem loading the .dae files for the ur5 from the ur_description package from the Universal Robots repository, but I'll try loading all the UR5 meshes from example-robot-data later today and post the results here.

danzimmerman commented 3 years ago

The MeshCat direct loads from example-robot-data work fine for me (red parts):

image

Having problems with the Pinocchio viewer versions, still trying to track that down.

Code:

``` import example_robot_data import pinocchio as pin import numpy as np import meshcat robot = example_robot_data.load('ur5') # Currently, MeshCat is not able to retrieve the scaling from DAE files. Set it manually. for geom in robot.visual_model.geometryObjects: s = geom.meshScale s *= 1.0 geom.meshScale = s robot.setVisualizer(pin.visualize.MeshcatVisualizer(robot.model, robot.collision_model, robot.visual_model)) robot.initViewer(open=True) robot.loadViewerModel('ur5_model') robot.display(robot.q0) # -- extract the concrete .dae paths from the text repr of robot.visual_model -- s = repr(robot.visual_model) meshes = {} #key, value like wrist2:path/to/wrist2.dae blocks = s.split('Absolute path to mesh file:')[1:] for block in blocks: meshpath = block.split('Scale')[0].strip() meshkey = meshpath.split('/')[-1].replace('.dae', '') meshes[meshkey] = meshpath # -- add wrist2.dae as a comparison material = meshcat.geometry.MeshPhongMaterial() material.color = 0x802317 dae_file = meshes['wrist2'] for n, (mk, mp) in enumerate(meshes.items()): mn = mk + '_comparison' robot.viz.viewer[mn].set_object(meshcat.geometry.DaeMeshGeometry.from_file(mp), material) print(f'Adding {dae_file}') T = np.array([[-1., 0., 0., 0.8+0.3*n], [ 0., 1., 0., 0.3], [-0., 0., -1., 0.1], [ 0., 0., 0., 1.]]) robot.viz.viewer[mn].set_transform(T) ```
danzimmerman commented 3 years ago

The above issue is fixed in Pinocchio 2.9.1 and is not a MeshCat issue per se.

danzimmerman commented 3 years ago

@nmansard I just upgraded to meshcat-python 0.3.1 via conda-forge (on Windows) and now I can no longer see most of the links for the example-robot-data meshes for the UR robots.

Small self-contained example that fetches the meshes from the URL:

import meshcat
import urllib
import io
viz = meshcat.Visualizer()
viz.open()
robot = 'panda' #panda or ur5
if robot == 'ur5':
    links = ['base', 'forearm', 'shoulder', 'upperarm', 'wrist1', 'wrist2', 'wrist3']
    url_template = r'https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/{0}.dae'
elif robot == 'panda':
    links = ['finger', 'hand'] + [f'link{n}' for n in range(0, 8)]
    url_template = r'https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/{0}.dae'

for n, linkname in enumerate(links):
    url = url_template.format(linkname)
    print(url)
    with urllib.request.urlopen(url) as urf:
        xml_str = ''.join([line.decode('utf-8') for line in urf])
        with io.StringIO(xml_str) as xml_iofile:
            geom = meshcat.geometry.DaeMeshGeometry.from_stream(xml_iofile)
    viz[linkname].set_object(geom)
    viz[linkname].set_transform(meshcat.transformations.translation_matrix([0, 0, n/5.0]))

UR5 Result

I can only see base and wrist3

You can open the visualizer by visiting the following URL:
http://127.0.0.1:7004/static/
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/base.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/forearm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/shoulder.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/upperarm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist1.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist2.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist3.dae

image

Panda Result

Seems like the links are all there

You can open the visualizer by visiting the following URL:
http://127.0.0.1:7005/static/
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/finger.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/hand.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link0.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link1.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link2.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link3.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link4.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link5.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link6.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/link7.dae

image

I also have this problem with the ur_description meshes from the Universal Robots repository. Obviously something wrong with them with respect to meshcat.

Will update if I can find a solution.

danzimmerman commented 3 years ago

Reproduced this in fresh Conda enviroments with meshcat-python 0.1.1 and 0.3.1.

System is Windows 11, Google Chrome, Python 3.8

Python code snippet

```python import meshcat import urllib import io import os from importlib.metadata import version viz = meshcat.Visualizer() viz.open() robot = 'ur5' #panda or ur5 if robot == 'ur5': links = ['base', 'forearm', 'shoulder', 'upperarm', 'wrist1', 'wrist2', 'wrist3'] url_template = r'https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/{0}.dae' elif robot == 'panda': links = ['finger', 'hand'] + [f'link{n}' for n in range(0, 8)] url_template = r'https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/panda_description/meshes/visual/{0}.dae' conda_env = os.environ['CONDA_DEFAULT_ENV'] meshcat_ver = version('meshcat') print(f'Visualizing with Meshcat {meshcat_ver} in environment {conda_env}') for n, linkname in enumerate(links): url = url_template.format(linkname) print(url) with urllib.request.urlopen(url) as urf: xml_str = ''.join([line.decode('utf-8') for line in urf]) with io.StringIO(xml_str) as xml_iofile: geom = meshcat.geometry.DaeMeshGeometry.from_stream(xml_iofile) viz[linkname].set_object(geom) viz[linkname].set_transform(meshcat.transformations.translation_matrix([n/5.0, 0, 0])) ```

Ran the above in a Jupyter notebook.

Testing meshcat-python 0.1.1 in mc011viztest Environment

Conda Environment YAML

```yaml name: mc011viztest channels: - conda-forge - defaults dependencies: - jupyter - python=3.8 - meshcat-python=0.1.1 ```

Resulting Conda Environment

``` argon2-cffi 21.1.0 py38h294d835_0 conda-forge async_generator 1.10 py_0 conda-forge attrs 21.2.0 pyhd8ed1ab_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bleach 4.1.0 pyhd8ed1ab_0 conda-forge ca-certificates 2021.10.8 h5b45459_0 conda-forge cffi 1.14.6 py38hd8c33c5_1 conda-forge colorama 0.4.4 pyh9f0ad1d_0 conda-forge debugpy 1.4.1 py38h885f38d_0 conda-forge decorator 5.1.0 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge entrypoints 0.3 py38h32f6830_1002 conda-forge icu 68.1 h0e60522_0 conda-forge importlib-metadata 4.8.1 py38haa244fe_0 conda-forge intel-openmp 2021.4.0 h57928b3_3556 conda-forge ipykernel 6.4.2 py38h595d716_0 conda-forge ipython 7.28.0 py38h595d716_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.6.5 pyhd8ed1ab_0 conda-forge jedi 0.18.0 py38haa244fe_2 conda-forge jinja2 3.0.2 pyhd8ed1ab_0 conda-forge jpeg 9d h8ffe710_0 conda-forge jsonschema 4.1.2 pyhd8ed1ab_0 conda-forge jupyter 1.0.0 py38haa244fe_6 conda-forge jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge jupyter_console 6.4.0 pyhd8ed1ab_1 conda-forge jupyter_core 4.9.0 py38haa244fe_0 conda-forge jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_widgets 1.0.2 pyhd8ed1ab_0 conda-forge libblas 3.9.0 12_win64_mkl conda-forge libcblas 3.9.0 12_win64_mkl conda-forge libclang 11.1.0 default_h5c34c98_1 conda-forge liblapack 3.9.0 12_win64_mkl conda-forge libpng 1.6.37 h1d00b33_2 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libzlib 1.2.11 h8ffe710_1013 conda-forge markupsafe 2.0.1 py38h294d835_0 conda-forge matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge meshcat-python 0.1.1 pyhd8ed1ab_0 conda-forge mistune 0.8.4 py38h294d835_1004 conda-forge mkl 2021.4.0 h0e2418a_729 conda-forge nbclient 0.5.4 pyhd8ed1ab_0 conda-forge nbconvert 6.2.0 py38haa244fe_0 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge notebook 6.4.5 pyha770c72_0 conda-forge numpy 1.21.3 py38h089cfbf_0 conda-forge openssl 1.1.1l h8ffe710_0 conda-forge packaging 21.0 pyhd8ed1ab_0 conda-forge pandoc 2.15 h8ffe710_0 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge parso 0.8.2 pyhd8ed1ab_0 conda-forge pickleshare 0.7.5 py38h32f6830_1002 conda-forge pip 21.3.1 pyhd8ed1ab_0 conda-forge prometheus_client 0.11.0 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.21 pyha770c72_0 conda-forge prompt_toolkit 3.0.21 hd8ed1ab_0 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pygments 2.10.0 pyhd8ed1ab_0 conda-forge pyngrok 5.1.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.3 pyhd8ed1ab_0 conda-forge pyqt 5.12.3 py38haa244fe_7 conda-forge pyqt-impl 5.12.3 py38h885f38d_7 conda-forge pyqt5-sip 4.19.18 py38h885f38d_7 conda-forge pyqtchart 5.12 py38h885f38d_7 conda-forge pyqtwebengine 5.12.1 py38h885f38d_7 conda-forge pyrsistent 0.17.3 py38h294d835_2 conda-forge python 3.8.12 h7840368_2_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python_abi 3.8 2_cp38 conda-forge pywin32 301 py38h294d835_0 conda-forge pywinpty 1.1.4 py38hd3f51b4_0 conda-forge pyyaml 6.0 py38h294d835_0 conda-forge pyzmq 22.3.0 py38h09162b1_0 conda-forge qt 5.12.9 h5909a2a_4 conda-forge qtconsole 5.1.1 pyhd8ed1ab_0 conda-forge qtpy 1.11.2 pyhd8ed1ab_0 conda-forge send2trash 1.8.0 pyhd8ed1ab_0 conda-forge setuptools 58.2.0 py38haa244fe_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge sqlite 3.36.0 h8ffe710_2 conda-forge tbb 2021.4.0 h2d74725_0 conda-forge terminado 0.12.1 py38haa244fe_0 conda-forge testpath 0.5.0 pyhd8ed1ab_0 conda-forge tornado 6.1 py38h294d835_1 conda-forge traitlets 5.1.1 pyhd8ed1ab_0 conda-forge u-msgpack-python 2.7.1 pyh9f0ad1d_0 conda-forge ucrt 10.0.20348.0 h57928b3_0 conda-forge vc 14.2 hb210afc_5 conda-forge vs2015_runtime 14.29.30037 h902a5da_5 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.37.0 pyhd8ed1ab_1 conda-forge widgetsnbextension 3.5.1 py38haa244fe_4 conda-forge winpty 0.4.3 4 conda-forge yaml 0.2.5 he774522_0 conda-forge zeromq 4.3.4 h0e60522_1 conda-forge zipp 3.6.0 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h8ffe710_1013 conda-forge ```

Result

You can open the visualizer by visiting the following URL:
http://127.0.0.1:7000/static/
Visualizing with Meshcat 0.1.1 in environment mc011viztest
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/base.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/forearm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/shoulder.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/upperarm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist1.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist2.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist3.dae

image

JS Console Output - Chrome

A number of Javascript warnings but no errors, details below.

```javascript Using OBJLoader2 version: 3.1.1 main.min.js:35 ws://127.0.0.1:7000 main.min.js:35 connection: WebSocket main.min.js:35 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:35 main.min.js:5 THREE.ColladaLoader: File version 1.4.1 main.min.js:5 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light oe @ main.min.js:5 main.min.js:35 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:35 main.min.js:5 THREE.ColladaLoader: File version 1.4.1 main.min.js:5 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light oe @ main.min.js:5 main.min.js:35 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:35 main.min.js:5 THREE.ColladaLoader: File version 1.4.1 main.min.js:5 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light oe @ main.min.js:5 main.min.js:35 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 main.min.js:5 THREE.ColladaLoader: File version 1.4.1 main.min.js:5 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light oe @ main.min.js:5 Oe @ main.min.js:5 f @ main.min.js:5 ke @ main.min.js:5 Ue @ main.min.js:5 p @ main.min.js:5 parse @ main.min.js:5 handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 main.min.js:35 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 main.min.js:5 THREE.ColladaLoader: File version 1.4.1 main.min.js:5 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light oe @ main.min.js:5 Oe @ main.min.js:5 f @ main.min.js:5 ke @ main.min.js:5 Ue @ main.min.js:5 p @ main.min.js:5 parse @ main.min.js:5 handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 main.min.js:35 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 main.min.js:5 THREE.ColladaLoader: File version 1.4.1 main.min.js:5 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light oe @ main.min.js:5 Oe @ main.min.js:5 f @ main.min.js:5 ke @ main.min.js:5 Ue @ main.min.js:5 p @ main.min.js:5 parse @ main.min.js:5 handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 main.min.js:35 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 main.min.js:5 THREE.ColladaLoader: File version 1.4.1 main.min.js:5 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light oe @ main.min.js:5 Oe @ main.min.js:5 f @ main.min.js:5 ke @ main.min.js:5 Ue @ main.min.js:5 p @ main.min.js:5 parse @ main.min.js:5 handle_special_geometry @ main.min.js:35 delegate @ main.min.js:35 parseGeometries @ main.min.js:35 parse @ main.min.js:3 set_object_from_json @ main.min.js:35 handle_command @ main.min.js:35 handle_command_bytearray @ main.min.js:35 handle_command_message @ main.min.js:35 connection.onmessage @ main.min.js:35 ```

Testing meshcat-python 0.3.1 in mc031viztest Environment

Conda Environment YAML

```yaml name: mc031viztest channels: - conda-forge - defaults dependencies: - jupyter - python=3.8 - meshcat-python=0.3.1 ```

Resulting Conda Environment

``` argon2-cffi 21.1.0 py38h294d835_0 conda-forge async_generator 1.10 py_0 conda-forge attrs 21.2.0 pyhd8ed1ab_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bleach 4.1.0 pyhd8ed1ab_0 conda-forge ca-certificates 2021.10.8 h5b45459_0 conda-forge cffi 1.14.6 py38hd8c33c5_1 conda-forge colorama 0.4.4 pyh9f0ad1d_0 conda-forge debugpy 1.4.1 py38h885f38d_0 conda-forge decorator 5.1.0 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge entrypoints 0.3 py38h32f6830_1002 conda-forge freetype 2.10.4 h546665d_1 conda-forge icu 68.1 h0e60522_0 conda-forge importlib-metadata 4.8.1 py38haa244fe_0 conda-forge intel-openmp 2021.4.0 h57928b3_3556 conda-forge ipykernel 6.4.2 py38h595d716_0 conda-forge ipython 7.28.0 py38h595d716_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.6.5 pyhd8ed1ab_0 conda-forge jbig 2.1 h8d14728_2003 conda-forge jedi 0.18.0 py38haa244fe_2 conda-forge jinja2 3.0.2 pyhd8ed1ab_0 conda-forge jpeg 9d h8ffe710_0 conda-forge jsonschema 4.1.2 pyhd8ed1ab_0 conda-forge jupyter 1.0.0 py38haa244fe_6 conda-forge jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge jupyter_console 6.4.0 pyhd8ed1ab_1 conda-forge jupyter_core 4.9.0 py38haa244fe_0 conda-forge jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_widgets 1.0.2 pyhd8ed1ab_0 conda-forge lcms2 2.12 h2a16943_0 conda-forge lerc 3.0 h0e60522_0 conda-forge libblas 3.9.0 12_win64_mkl conda-forge libcblas 3.9.0 12_win64_mkl conda-forge libclang 11.1.0 default_h5c34c98_1 conda-forge libdeflate 1.8 h8ffe710_0 conda-forge liblapack 3.9.0 12_win64_mkl conda-forge libpng 1.6.37 h1d00b33_2 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libtiff 4.3.0 hd413186_2 conda-forge libzlib 1.2.11 h8ffe710_1013 conda-forge lz4-c 1.9.3 h8ffe710_1 conda-forge markupsafe 2.0.1 py38h294d835_0 conda-forge matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge meshcat-python 0.3.1 pyhd8ed1ab_0 conda-forge mistune 0.8.4 py38h294d835_1004 conda-forge mkl 2021.4.0 h0e2418a_729 conda-forge nbclient 0.5.4 pyhd8ed1ab_0 conda-forge nbconvert 6.2.0 py38haa244fe_0 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge notebook 6.4.5 pyha770c72_0 conda-forge numpy 1.21.3 py38h089cfbf_0 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openjpeg 2.4.0 hb211442_1 conda-forge openssl 1.1.1l h8ffe710_0 conda-forge packaging 21.0 pyhd8ed1ab_0 conda-forge pandoc 2.15 h8ffe710_0 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge parso 0.8.2 pyhd8ed1ab_0 conda-forge pickleshare 0.7.5 py38h32f6830_1002 conda-forge pillow 8.3.2 py38h794f750_0 conda-forge pip 21.3.1 pyhd8ed1ab_0 conda-forge prometheus_client 0.11.0 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.21 pyha770c72_0 conda-forge prompt_toolkit 3.0.21 hd8ed1ab_0 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pygments 2.10.0 pyhd8ed1ab_0 conda-forge pyngrok 5.1.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.3 pyhd8ed1ab_0 conda-forge pyqt 5.12.3 py38haa244fe_7 conda-forge pyqt-impl 5.12.3 py38h885f38d_7 conda-forge pyqt5-sip 4.19.18 py38h885f38d_7 conda-forge pyqtchart 5.12 py38h885f38d_7 conda-forge pyqtwebengine 5.12.1 py38h885f38d_7 conda-forge pyrsistent 0.17.3 py38h294d835_2 conda-forge python 3.8.12 h7840368_2_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python_abi 3.8 2_cp38 conda-forge pywin32 301 py38h294d835_0 conda-forge pywinpty 1.1.4 py38hd3f51b4_0 conda-forge pyyaml 6.0 py38h294d835_0 conda-forge pyzmq 22.3.0 py38h09162b1_0 conda-forge qt 5.12.9 h5909a2a_4 conda-forge qtconsole 5.1.1 pyhd8ed1ab_0 conda-forge qtpy 1.11.2 pyhd8ed1ab_0 conda-forge send2trash 1.8.0 pyhd8ed1ab_0 conda-forge setuptools 58.2.0 py38haa244fe_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge sqlite 3.36.0 h8ffe710_2 conda-forge tbb 2021.4.0 h2d74725_0 conda-forge terminado 0.12.1 py38haa244fe_0 conda-forge testpath 0.5.0 pyhd8ed1ab_0 conda-forge tk 8.6.11 h8ffe710_1 conda-forge tornado 6.1 py38h294d835_1 conda-forge traitlets 5.1.1 pyhd8ed1ab_0 conda-forge u-msgpack-python 2.7.1 pyh9f0ad1d_0 conda-forge ucrt 10.0.20348.0 h57928b3_0 conda-forge vc 14.2 hb210afc_5 conda-forge vs2015_runtime 14.29.30037 h902a5da_5 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.37.0 pyhd8ed1ab_1 conda-forge widgetsnbextension 3.5.1 py38haa244fe_4 conda-forge winpty 0.4.3 4 conda-forge xz 5.2.5 h62dcd97_1 conda-forge yaml 0.2.5 he774522_0 conda-forge zeromq 4.3.4 h0e60522_1 conda-forge zipp 3.6.0 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h8ffe710_1013 conda-forge zstd 1.5.0 h6255e5f_0 conda-forge ```

Result

You can open the visualizer by visiting the following URL:
http://127.0.0.1:7000/static/
Visualizing with Meshcat 0.3.1 in environment mc031viztest
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/base.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/forearm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/shoulder.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/upperarm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist1.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist2.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist3.dae

image

JS Console Output - Chrome

A number of TypeError errors from mergeBufferGeometries() (here I guess), details below.

```javascript main.min.js:2 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:2 main.min.js:2 THREE.ColladaLoader: File version 1.4.1 main.min.js:2 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light se @ main.min.js:2 main.min.js:2 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:2 main.min.js:2 THREE.ColladaLoader: File version 1.4.1 main.min.js:2 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light se @ main.min.js:2 main.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'mergeBufferGeometries') at merge_geometries (main.min.js:2) at handle_special_geometry (main.min.js:2) at ExtensibleObjectLoader.delegate (main.min.js:2) at ExtensibleObjectLoader.parseGeometries (main.min.js:2) at ExtensibleObjectLoader.parse (main.min.js:2) at Viewer.set_object_from_json (main.min.js:2) at Viewer.handle_command (main.min.js:2) at Viewer.handle_command_bytearray (main.min.js:2) at Viewer.handle_command_message (main.min.js:2) at WebSocket.connection.onmessage (main.min.js:2) main.min.js:2 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:2 main.min.js:2 THREE.ColladaLoader: File version 1.4.1 main.min.js:2 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light se @ main.min.js:2 main.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'mergeBufferGeometries') at merge_geometries (main.min.js:2) at handle_special_geometry (main.min.js:2) at ExtensibleObjectLoader.delegate (main.min.js:2) at ExtensibleObjectLoader.parseGeometries (main.min.js:2) at ExtensibleObjectLoader.parse (main.min.js:2) at Viewer.set_object_from_json (main.min.js:2) at Viewer.handle_command (main.min.js:2) at Viewer.handle_command_bytearray (main.min.js:2) at Viewer.handle_command_message (main.min.js:2) at WebSocket.connection.onmessage (main.min.js:2) main.min.js:2 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 THREE.ColladaLoader: File version 1.4.1 main.min.js:2 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light se @ main.min.js:2 ke @ main.min.js:2 f @ main.min.js:2 Be @ main.min.js:2 Fe @ main.min.js:2 p @ main.min.js:2 parse @ main.min.js:2 handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'mergeBufferGeometries') at merge_geometries (main.min.js:2) at handle_special_geometry (main.min.js:2) at ExtensibleObjectLoader.delegate (main.min.js:2) at ExtensibleObjectLoader.parseGeometries (main.min.js:2) at ExtensibleObjectLoader.parse (main.min.js:2) at Viewer.set_object_from_json (main.min.js:2) at Viewer.handle_command (main.min.js:2) at Viewer.handle_command_bytearray (main.min.js:2) at Viewer.handle_command_message (main.min.js:2) at WebSocket.connection.onmessage (main.min.js:2) merge_geometries @ main.min.js:2 handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 THREE.ColladaLoader: File version 1.4.1 main.min.js:2 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light se @ main.min.js:2 ke @ main.min.js:2 f @ main.min.js:2 Be @ main.min.js:2 Fe @ main.min.js:2 p @ main.min.js:2 parse @ main.min.js:2 handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'mergeBufferGeometries') at merge_geometries (main.min.js:2) at handle_special_geometry (main.min.js:2) at ExtensibleObjectLoader.delegate (main.min.js:2) at ExtensibleObjectLoader.parseGeometries (main.min.js:2) at ExtensibleObjectLoader.parse (main.min.js:2) at Viewer.set_object_from_json (main.min.js:2) at Viewer.handle_command (main.min.js:2) at Viewer.handle_command_bytearray (main.min.js:2) at Viewer.handle_command_message (main.min.js:2) at WebSocket.connection.onmessage (main.min.js:2) merge_geometries @ main.min.js:2 handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 THREE.ColladaLoader: File version 1.4.1 main.min.js:2 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light se @ main.min.js:2 ke @ main.min.js:2 f @ main.min.js:2 Be @ main.min.js:2 Fe @ main.min.js:2 p @ main.min.js:2 parse @ main.min.js:2 handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'mergeBufferGeometries') at merge_geometries (main.min.js:2) at handle_special_geometry (main.min.js:2) at ExtensibleObjectLoader.delegate (main.min.js:2) at ExtensibleObjectLoader.parseGeometries (main.min.js:2) at ExtensibleObjectLoader.parse (main.min.js:2) at Viewer.set_object_from_json (main.min.js:2) at Viewer.handle_command (main.min.js:2) at Viewer.handle_command_bytearray (main.min.js:2) at Viewer.handle_command_message (main.min.js:2) at WebSocket.connection.onmessage (main.min.js:2) merge_geometries @ main.min.js:2 handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 _meshfile is deprecated. Please use _meshfile_geometry for geometries and _meshfile_object for objects with geometry and material handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 main.min.js:2 THREE.ColladaLoader: File version 1.4.1 main.min.js:2 THREE.ColladaLoader: Couldn't find light with ID: Lamp-light se @ main.min.js:2 ke @ main.min.js:2 f @ main.min.js:2 Be @ main.min.js:2 Fe @ main.min.js:2 p @ main.min.js:2 parse @ main.min.js:2 handle_special_geometry @ main.min.js:2 delegate @ main.min.js:2 parseGeometries @ main.min.js:2 parse @ main.min.js:2 set_object_from_json @ main.min.js:2 handle_command @ main.min.js:2 handle_command_bytearray @ main.min.js:2 handle_command_message @ main.min.js:2 connection.onmessage @ main.min.js:2 ```
danzimmerman commented 3 years ago

Same result as above on Ubuntu 20.04 running on WSL (Linux-5.10.43.3-microsoft-standard-WSL2-x86_64-with-glibc2.10), rendering in Firefox.

The Firefox console error message seems a little more informative

Uncaught TypeError: three_examples_jsm_utils_BufferGeometryUtils_js__WEBPACK_IMPORTED_MODULE_2__.BufferGeometryUtils is undefined
    merge_geometries http://127.0.0.1:7000/static/main.min.js:2
    handle_special_geometry http://127.0.0.1:7000/static/main.min.js:2
    delegate http://127.0.0.1:7000/static/main.min.js:2
    parseGeometries http://127.0.0.1:7000/static/main.min.js:2
    parse http://127.0.0.1:7000/static/main.min.js:2
    set_object_from_json http://127.0.0.1:7000/static/main.min.js:2
    handle_command http://127.0.0.1:7000/static/main.min.js:2
    handle_command_bytearray http://127.0.0.1:7000/static/main.min.js:2
    handle_command_message http://127.0.0.1:7000/static/main.min.js:2
    onmessage http://127.0.0.1:7000/static/main.min.js:2

I don't have a native Linux machine around to try.

Reverting to 0.2.0 fixes the problem for me.

danzimmerman commented 3 years ago

Seems like this is related to meshcat/pull/99

My Conda-installed version of meshcat-python 0.3.1 still imports BufferGeometryUtils in index.js

Modifying line 4 and line 39 in index.js to match meshcat/pull/99 and rebuilding main.min.js according to the instructions fixes the problem.

You can open the visualizer by visiting the following URL:
http://127.0.0.1:7002/static/
Visualizing with Meshcat 0.3.1 in environment mc031viztest on Windows-10-10.0.22000-SP0
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/base.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/forearm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/shoulder.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/upperarm.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist1.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist2.dae
https://gepgitlab.laas.fr/gepetto/example-robot-data/-/raw/master/robots/ur_description/meshes/ur5/visual/wrist3.dae

image

cmastalli commented 2 years ago

What is the status of this issue?

I cannot display ANYmal (using https://github.com/Gepetto/example-robot-data) properly. See the picture for more details:

Screenshot 2022-05-10 at 14 15 34

I am using Pinocchio v2.6.7