Hi all, first of all, thank you for the effort to develop and maintain pinocchio.
I was trying to visualize the Talos robot following this example. However I noticed that the model is not correctly loaded in meshcat.
Indeed there seems that the right shoulder and the legs are not correctly attached to the robot body.
| Real Talos | Visualized Talos |
| :----:|:----:|
| |
|
I installed meshcat and pinocchio with conda in a clean Ubuntu 20.04 distro.
For reference, my packages are:
conda list
# packages in environment at /home/gromualdi/miniforge3/envs/pinocchio-env:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 1_llvm conda-forge
assimp 5.0.1 hedfc422_5 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
boost 1.74.0 py39h5472131_3 conda-forge
boost-cpp 1.74.0 h312852a_4 conda-forge
bzip2 1.0.8 h7f98852_4 conda-forge
ca-certificates 2021.5.30 ha878542_0 conda-forge
certifi 2021.5.30 py39hf3d152e_0 conda-forge
console_bridge 1.0.1 h4bd325d_0 conda-forge
decorator 5.0.9 pyhd8ed1ab_0 conda-forge
eigen 3.3.9 h4bd325d_1 conda-forge
eigenpy 2.6.4 py39h5aed9d1_0 conda-forge
hpp-fcl 1.7.4 py39hbcdfc36_0 conda-forge
icu 68.1 h58526e2_0 conda-forge
ipython 7.25.0 py39hef51801_1 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
jedi 0.18.0 py39hf3d152e_2 conda-forge
ld_impl_linux-64 2.36.1 hea4e1c9_1 conda-forge
libblas 3.9.0 9_openblas conda-forge
libcblas 3.9.0 9_openblas conda-forge
libffi 3.3 h58526e2_2 conda-forge
libgcc-ng 9.3.0 h2828fa1_19 conda-forge
libgfortran-ng 9.3.0 hff62375_19 conda-forge
libgfortran5 9.3.0 hff62375_19 conda-forge
liblapack 3.9.0 9_openblas conda-forge
libopenblas 0.3.15 pthreads_h8fe5266_1 conda-forge
libsodium 1.0.18 h36c2ea0_1 conda-forge
libstdcxx-ng 9.3.0 h6de172a_19 conda-forge
llvm-openmp 12.0.1 h4bd325d_0 conda-forge
lz4-c 1.9.3 h9c3ff4c_0 conda-forge
matplotlib-inline 0.1.2 pyhd8ed1ab_2 conda-forge
meshcat-python 0.1.1 pyhd8ed1ab_0 conda-forge
ncurses 6.2 h58526e2_4 conda-forge
numpy 1.21.0 py39hdbf815f_0 conda-forge
octomap 1.9.7 h4bd325d_0 conda-forge
openssl 1.1.1k h7f98852_0 conda-forge
parso 0.8.2 pyhd8ed1ab_0 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pinocchio 2.6.2 py39hbcdfc36_0 conda-forge
pip 21.1.3 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.19 pyha770c72_0 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pygments 2.9.0 pyhd8ed1ab_0 conda-forge
pyngrok 5.0.5 pyhd8ed1ab_0 conda-forge
python 3.9.6 h49503c6_1_cpython conda-forge
python_abi 3.9 2_cp39 conda-forge
pyyaml 5.4.1 py39h3811e60_0 conda-forge
pyzmq 22.1.0 py39h37b5a0c_0 conda-forge
readline 8.1 h46c0cb4_0 conda-forge
setuptools 49.6.0 py39hf3d152e_3 conda-forge
sqlite 3.36.0 h9cd32fc_0 conda-forge
tinyxml 2.6.2 h4bd325d_2 conda-forge
tk 8.6.10 h21135ba_1 conda-forge
tornado 6.1 py39h3811e60_1 conda-forge
traitlets 5.0.5 py_0 conda-forge
tzdata 2021a he74cb21_1 conda-forge
u-msgpack-python 2.7.1 pyh9f0ad1d_0 conda-forge
urdfdom 2.3.5 h4bd325d_0 conda-forge
urdfdom_headers 1.0.5 h4bd325d_2 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
wheel 0.36.2 pyhd3deb0d_0 conda-forge
xz 5.2.5 h516909a_1 conda-forge
yaml 0.2.5 h516909a_0 conda-forge
zeromq 4.3.4 h9c3ff4c_0 conda-forge
zlib 1.2.11 h516909a_1010 conda-forge
zstd 1.5.0 ha95c52a_0 conda-forge
Could you help me to solve this issue? Thank you in advance
cc @traversaro
Thanks @GiulioRomualdi for raising this issue and reporting for this bug.
I think this is due to some slight but important changes in the way we parse frames in the URDF parser and which has been introduced in Pinocchio 2.6.0.
You can use 2.5.6 in meantime, and I will provide a fix later this day.
Hi @jcarpent. Thank you! With pinocchio 2.5.6 the problem disappears
@GiulioRomualdi I've fixed the bug and in fact it was only related to Meshcat support of Pinocchio.
Please cherry-pick this commit 24dbede to solve locally your issue.
I will provide a release soon to fix it at least on conda.
Thanks again for the quick report.
@GiulioRomualdi Could you confirm that fixes your issue in robotology/icub-models#97?
@GiulioRomualdi I've fixed the bug and in fact it was only related to Meshcat support of Pinocchio.
Please cherry-pick this commit 24dbede to solve locally your issue.I will provide a release soon to fix it at least on conda.
Thanks again for the quick report.
https://github.com/stack-of-tasks/pinocchio/commit/24dbede81e884dc0be2bb05ecd1d3f7171cba982 solves the problem with Talos and Pinocchio 2.6.2. However, when I try to load the iCub (robotology/icub-models#97) the meshes are not scaled

without 24dbede the meshes are scaled even if the robot is not correctly loaded
Adding the following lines after
q0 = pin.neutral(model)
viz.display(q0)
viz.loadViewerModel() here, the robot is scaled and in the neutral configuration.

Looking in the code seems the meshes are scaled only when display is called (e.g. https://github.com/stack-of-tasks/pinocchio/pull/1472/commits/50f49cc7fc3ddd110f4bd09d381b9afb081e7ffa). Is it wanted?
I've just update #1472 to also scale the geometries when loading the meshes.
Yet, it seems that there is a bug within MeshCat to use the scaling information when changing the placement (via set_transform).
Small remark: according to https://github.com/rdeits/meshcat/blob/1ea52a649c0c8df800587b54d0910ef2868f8de5/src/index.js#L357-L361, it seems that Meshcat erases the previous scaling.
Solved by #1472
Thanks a lot @jcarpent for the fix!
Most helpful comment
Solved by #1472