Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems in loading stickbot with urdf parser py #49

Closed
CarlottaSartore opened this issue Nov 7, 2023 · 18 comments
Closed

Problems in loading stickbot with urdf parser py #49

CarlottaSartore opened this issue Nov 7, 2023 · 18 comments

Comments

@CarlottaSartore
Copy link
Contributor

CarlottaSartore commented Nov 7, 2023

I am having issues in loading the stickbot urdf in urdf parser py, due to the declaration of XML encoding

<?xml version='1.0' encoding='UTF-8'?>

see attached log:

Errort

___ ERROR collecting tests/parametric/test_NumPy_computations_parametric.py ____ ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/runner.py:341: in from_call result: Optional[TResult] = func() ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/runner.py:372: in call = CallInfo.from_call(lambda: list(collector.collect()), "collect") ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/python.py:531: in collect self._inject_setup_module_fixture() ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture self.obj, ("setUpModule", "setup_module") ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/python.py:310: in obj self._obj = obj = self._getobj() ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/python.py:528: in _getobj return self._importtestmodule() ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/python.py:617: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/pathlib.py:567: in import_path importlib.import_module(module_name) ../../../micromamba/envs/adamdev/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) :1204: in _gcd_import ??? :1176: in _find_and_load ??? :1147: in _find_and_load_unlocked ??? :690: in _load_unlocked ??? ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:186: in exec_module exec(co, module.__dict__) tests/parametric/test_NumPy_computations_parametric.py:63: in comp = KinDynComputations(model_path, joints_name_list, root_link) ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/adam/numpy/computations.py:32: in __init__ factory = URDFModelFactory(path=urdfstring, math=math) ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/adam/model/std_factories/std_model.py:24: in __init__ self.urdf_desc = urdf_parser_py.urdf.URDF.from_xml_file(path) ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/urdf_parser_py/xml_reflection/core.py:617: in from_xml_file return cls.from_xml_string(xml_string) ../../../micromamba/envs/adamdev/lib/python3.11/site-packages/urdf_parser_py/xml_reflection/core.py:610: in from_xml_string node = etree.fromstring(xml_string) src/lxml/etree.pyx:3257: in lxml.etree.fromstring ??? src/lxml/parser.pxi:1911: in lxml.etree._parseMemoryDocument ???

This is an output of a CI (see https://github.com/CarlottaSartore/ADAM/actions/runs/6783258175), In my setup it does not happen, I attach here the conda list

Working Env Conda List

# packages in environment at /home/carlotta/miniforge3/envs/ADAM_env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                  2_kmp_llvm    conda-forge
absl-py                   1.4.0              pyhd8ed1ab_0    conda-forge
ace                       7.1.1                h59595ed_0    conda-forge
adam-robotics             0.0.8.dev19              pypi_0    pypi
alsa-lib                  1.2.10               hd590300_0    conda-forge
ampl-mp                   3.1.0             h2cc385e_1006    conda-forge
aom                       3.5.0                h27087fc_0    conda-forge
assimp                    5.2.5                hf40c2ba_0    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
binutils                  2.39                 hdd6e379_1    conda-forge
binutils_impl_linux-64    2.39                 he00db2b_1    conda-forge
binutils_linux-64         2.39                h5fc0e48_12    conda-forge
boost-cpp                 1.78.0               h2c5509c_4    conda-forge
brotli                    1.0.9                h166bdaf_8    conda-forge
brotli-bin                1.0.9                h166bdaf_8    conda-forge
brotlipy                  0.7.0           py310h5764c6d_1005    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.18.1               h7f98852_0    conda-forge
c-compiler                1.5.2                h0b41bf4_0    conda-forge
ca-certificates           2023.7.22            hbcca054_0    conda-forge
cairo                     1.18.0               h3faef2a_0    conda-forge
casadi                    3.6.3           py310h528c296_0    conda-forge
certifi                   2023.7.22          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py310h255011f_3    conda-forge
charset-normalizer        3.1.0              pyhd8ed1ab_0    conda-forge
cloudpickle               2.2.1                    pypi_0    pypi
cmake                     3.26.3               h077f3f9_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comodo                    0.0.1                    pypi_0    pypi
compilers                 1.5.2                ha770c72_0    conda-forge
contourpy                 1.0.7           py310hdf3cbec_0    conda-forge
cppad                     20230000.0           hcb278e6_0    conda-forge
cryptography              40.0.2          py310h34c0648_0    conda-forge
curl                      8.4.0                hca28451_0    conda-forge
cxx-compiler              1.5.2                hf52228f_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
dav1d                     1.2.1                hd590300_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
eigen                     3.4.0                h4bd325d_0    conda-forge
entrypoints               0.4                      pypi_0    pypi
etils                     1.5.1              pyhd8ed1ab_0    conda-forge
exceptiongroup            1.1.3              pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
ffmpeg                    6.0.0           gpl_hdbbbd96_103    conda-forge
filelock                  3.13.1             pyhd8ed1ab_0    conda-forge
fmt                       9.1.0                h924138e_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.39.3          py310h1fa729e_0    conda-forge
fortran-compiler          1.5.2                hdb1a99f_0    conda-forge
freeglut                  3.2.2                hac7e632_2    conda-forge
freetype                  2.12.1               hca18f0e_1    conda-forge
freetype-py               2.3.0              pyhd8ed1ab_0    conda-forge
fribidi                   1.0.10               h36c2ea0_0    conda-forge
fsspec                    2023.10.0          pyhca7485f_0    conda-forge
future                    0.18.3             pyhd8ed1ab_0    conda-forge
gcc                       11.3.0              h02d0930_12    conda-forge
gcc_impl_linux-64         11.3.0              hab1b70f_19    conda-forge
gcc_linux-64              11.3.0              he6f903b_12    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
gfortran                  11.3.0              ha859ce3_12    conda-forge
gfortran_impl_linux-64    11.3.0              he34c6f7_19    conda-forge
gfortran_linux-64         11.3.0              h3c55166_12    conda-forge
git                       2.42.0          pl5321h86e50cf_0    conda-forge
gitdb                     4.0.10                   pypi_0    pypi
gitpython                 3.1.37                   pypi_0    pypi
glfw                      3.3.8                h166bdaf_0    conda-forge
glib                      2.78.1               hfc55251_0    conda-forge
glib-tools                2.78.1               hfc55251_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gmpy2                     2.1.2           py310h3ec546c_1    conda-forge
gnutls                    3.7.8                hf3e180e_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
gst-plugins-base          1.22.6               h8e1006c_2    conda-forge
gstreamer                 1.22.6               h98fc4e7_2    conda-forge
gxx                       11.3.0              h02d0930_12    conda-forge
gxx_impl_linux-64         11.3.0              hab1b70f_19    conda-forge
gxx_linux-64              11.3.0              hc203a17_12    conda-forge
harfbuzz                  8.2.1                h3d44ed6_0    conda-forge
hdf5                      1.14.2          nompi_h4f84152_100    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
icub-models               2.4.1           py310hc6cd4ac_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
idyntree                  9.1.0           py310hcc9ab6b_1    conda-forge
imageio                   2.27.0             pyh24c5eb1_0    conda-forge
importlib-metadata        6.8.0              pyha770c72_0    conda-forge
importlib_metadata        6.8.0                hd8ed1ab_0    conda-forge
importlib_resources       6.1.0              pyhd8ed1ab_0    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
ipopt                     3.14.12              hf9e1ecf_0    conda-forge
ipython                   8.12.0             pyh41d4057_0    conda-forge
irrlicht                  1.8.5                h2a6caf8_4    conda-forge
jasper                    4.1.0                he6dfbbe_0    conda-forge
jax                       0.4.19             pyhd8ed1ab_0    conda-forge
jaxlib                    0.4.14          cpu_py310h67d73b5_1    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_15    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.4           py310hbf28c38_1    conda-forge
krb5                      1.21.2               h659d440_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.15                 hb7c19ff_3    conda-forge
ld_impl_linux-64          2.39                 hcc3a1bd_1    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libabseil                 20230125.3      cxx17_h59595ed_0    conda-forge
libaec                    1.0.6                hcb278e6_1    conda-forge
libass                    0.17.1               h8fe9dca_1    conda-forge
libblas                   3.9.0           16_linux64_openblas    conda-forge
libbrotlicommon           1.0.9                h166bdaf_8    conda-forge
libbrotlidec              1.0.9                h166bdaf_8    conda-forge
libbrotlienc              1.0.9                h166bdaf_8    conda-forge
libcap                    2.67                 he9d0100_0    conda-forge
libcblas                  3.9.0           16_linux64_openblas    conda-forge
libccd-double             2.1                  h27087fc_3    conda-forge
libclang                  15.0.7          default_h7634d5b_3    conda-forge
libclang13                15.0.7          default_h9986a30_3    conda-forge
libcups                   2.3.3                h4637d8d_4    conda-forge
libcurl                   8.4.0                hca28451_0    conda-forge
libdeflate                1.19                 hd590300_0    conda-forge
libdrm                    2.4.114              h166bdaf_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.2                h27087fc_0    conda-forge
libgcc-devel_linux-64     11.3.0              h210ce93_19    conda-forge
libgcc-ng                 12.2.0              h65d4601_19    conda-forge
libgcrypt                 1.10.1               h166bdaf_0    conda-forge
libgfortran-ng            13.2.0               h69a702a_0    conda-forge
libgfortran5              13.2.0               ha4646dd_0    conda-forge
libglib                   2.78.1               hebfc3b9_0    conda-forge
libglu                    9.0.0             he1b5a44_1001    conda-forge
libgomp                   12.2.0              h65d4601_19    conda-forge
libgpg-error              1.46                 h620e276_0    conda-forge
libgrpc                   1.54.2               hb20ce57_2    conda-forge
libhwloc                  2.9.3           default_h554bfaf_1009    conda-forge
libi2c                    4.3                  hcb278e6_2    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libidn2                   2.3.4                h166bdaf_0    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
liblapack                 3.9.0           16_linux64_openblas    conda-forge
liblapacke                3.9.0           16_linux64_openblas    conda-forge
liblie-group-controllers  0.2.0                hcb278e6_0    conda-forge
libllvm15                 15.0.7               h5cf9203_3    conda-forge
libllvm16                 16.0.6               h5cf9203_1    conda-forge
libmatio                  1.5.23               h31675a7_4    conda-forge
libmatio-cpp              0.2.2                h002c22a_0    conda-forge
libmujoco                 2.3.7                hd8909ca_0    conda-forge
libnghttp2                1.52.0               h61bc06f_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.21          pthreads_h78a6416_3    conda-forge
libopencv                 4.8.1            py39h72824ba_5    conda-forge
libopenvino               2023.1.0             h59595ed_1    conda-forge
libopenvino-auto-batch-plugin 2023.1.0             h59595ed_1    conda-forge
libopenvino-auto-plugin   2023.1.0             h59595ed_1    conda-forge
libopenvino-hetero-plugin 2023.1.0             h59595ed_1    conda-forge
libopenvino-intel-cpu-plugin 2023.1.0             h59595ed_1    conda-forge
libopenvino-intel-gpu-plugin 2023.1.0             h59595ed_1    conda-forge
libopenvino-ir-frontend   2023.1.0             h59595ed_1    conda-forge
libopenvino-onnx-frontend 2023.1.0             h59595ed_1    conda-forge
libopenvino-paddle-frontend 2023.1.0             h59595ed_1    conda-forge
libopenvino-pytorch-frontend 2023.1.0             h59595ed_1    conda-forge
libopenvino-tensorflow-frontend 2023.1.0             h59595ed_1    conda-forge
libopenvino-tensorflow-lite-frontend 2023.1.0             h59595ed_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libosqp                   0.6.3                h59595ed_0    conda-forge
libpciaccess              0.17                 h166bdaf_0    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libpq                     16.0                 hfc447b1_1    conda-forge
libprotobuf               3.21.12              hfc55251_2    conda-forge
libqdldl                  0.1.5                h27087fc_1    conda-forge
librealsense              2.54.1           h8386552_1_cpu    conda-forge
librobometry              1.2.1                hc5a7426_1    conda-forge
libsanitizer              11.3.0              h239ccf8_19    conda-forge
libsndfile                1.2.0                hb75c966_0    conda-forge
libsqlite                 3.44.0               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-devel_linux-64  11.3.0              h210ce93_19    conda-forge
libstdcxx-ng              12.2.0              h46fd767_19    conda-forge
libsystemd0               253                  h8c4010b_1    conda-forge
libtasn1                  4.19.0               h166bdaf_0    conda-forge
libtiff                   4.6.0                ha9c0a0a_2    conda-forge
libudev1                  253                  h0b41bf4_1    conda-forge
libunicycle-footstep-planner 0.6.0                h59595ed_1    conda-forge
libunistring              0.9.10               h7f98852_0    conda-forge
libusb                    1.0.26             h0b4f0b6_100    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libuv                     1.46.0               hd590300_0    conda-forge
libva                     2.18.0               h0b41bf4_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libvpx                    1.13.0               hcb278e6_0    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxkbcommon              1.6.0                h5d7e998_0    conda-forge
libxml2                   2.11.5               h232c23b_1    conda-forge
libxslt                   1.1.37               h0054252_1    conda-forge
libzlib                   1.2.13               h166bdaf_4    conda-forge
llvm-openmp               17.0.4               h4dfa4b3_0    conda-forge
lodepng                   20220109             h924138e_0    conda-forge
lxml                      4.9.3           py310h9b7343a_0    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
make                      4.3                  hd18ef5c_1    conda-forge
manif                     0.0.4               hcb278e6_13    conda-forge
manifpy                   0.0.4           py310haded995_13    conda-forge
markupsafe                2.1.3           py310h2372a71_1    conda-forge
matplotlib                3.7.1           py310hff52083_0    conda-forge
matplotlib-base           3.7.1           py310he60537e_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
metis                     5.1.0             h58526e2_1006    conda-forge
mkl                       2022.2.1         h84fe81f_16997    conda-forge
ml_dtypes                 0.3.1           py310hcc13569_2    conda-forge
mpc                       1.3.1                hfe3b2da_0    conda-forge
mpfr                      4.2.1                h9458935_0    conda-forge
mpg123                    1.31.3               hcb278e6_0    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
mujoco-python             2.3.7           py310h99e3f1e_0    conda-forge
mujoco-python-viewer      0.1.2                    pypi_0    pypi
mumps-include             5.2.1               ha770c72_11    conda-forge
mumps-seq                 5.2.1               h2104b81_11    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mysql-common              8.0.33               hf1915f5_6    conda-forge
mysql-libs                8.0.33               hca2cd23_6    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
nettle                    3.8.1                hc379101_1    conda-forge
networkx                  3.1                pyhd8ed1ab_0    conda-forge
ninja                     1.11.1               h924138e_0    conda-forge
nlohmann_json             3.11.2               h27087fc_0    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.94                 h1d7d5a4_0    conda-forge
numpy                     1.22.4          py310h4ef5377_0    conda-forge
ocl-icd                   2.3.1                h7f98852_0    conda-forge
ocl-icd-system            1.0.0                         1    conda-forge
openh264                  2.3.1                hcb278e6_2    conda-forge
openjpeg                  2.5.0                h488ebb8_3    conda-forge
openssl                   3.1.4                hd590300_0    conda-forge
opt-einsum                3.3.0                hd8ed1ab_2    conda-forge
opt_einsum                3.3.0              pyhc1e730c_2    conda-forge
osqp-eigen                0.8.0                hdd734ac_1    conda-forge
p11-kit                   0.24.1               hc5aa10d_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pandas                    2.0.0                    pypi_0    pypi
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
perl                      5.32.1          4_hd590300_perl5    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.1.0          py310h01dd4db_0    conda-forge
pip                       23.1               pyhd8ed1ab_0    conda-forge
pixman                    0.42.2               h59595ed_0    conda-forge
pkg-config                0.29.2            h36c2ea0_1008    conda-forge
platformdirs              3.2.0              pyhd8ed1ab_0    conda-forge
pluggy                    1.3.0              pyhd8ed1ab_0    conda-forge
ply                       3.11                       py_1    conda-forge
pooch                     1.7.0              pyha770c72_3    conda-forge
portaudio                 19.6.0               h7c63dc7_9    conda-forge
prettytable               3.7.0                    pypi_0    pypi
prompt-toolkit            3.0.38             pyha770c72_0    conda-forge
prompt_toolkit            3.0.38               hd8ed1ab_0    conda-forge
proxsuite                 0.3.7           py310hd41b1e2_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pugixml                   1.14                 h59595ed_0    conda-forge
pulseaudio-client         16.1                 h5195f5e_3    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycollada                 0.7.2              pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygad                     3.1.0                    pypi_0    pypi
pyglet                    1.5.16          py310hff52083_1    conda-forge
pyglfw                    2.5.9           py310hff52083_0    conda-forge
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pyopengl                  3.1.6              pyhd8ed1ab_1    conda-forge
pyopenssl                 23.1.1             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
pyqt                      5.15.7          py310hab646b1_3    conda-forge
pyqt5-sip                 12.11.0         py310heca2aa9_3    conda-forge
pyrender                  0.1.45             pyh8a188c0_3    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
pytest                    7.4.3              pyhd8ed1ab_0    conda-forge
python                    3.10.10         he550d4f_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.10                    3_cp310    conda-forge
pytorch                   2.0.0           cpu_mkl_py310h402c8e3_101    conda-forge
pytz                      2023.3                   pypi_0    pypi
pyyaml                    6.0                      pypi_0    pypi
qhull                     2020.2               h4bd325d_2    conda-forge
qt-main                   5.15.8              h82b777d_17    conda-forge
re2                       2023.03.02           h8c504da_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
requests                  2.28.2             pyhd8ed1ab_1    conda-forge
rhash                     1.4.3                h166bdaf_0    conda-forge
robot-testing-framework   2.0.1                hcb278e6_1    conda-forge
scipy                     1.10.1          py310h8deb116_0    conda-forge
scotch                    6.0.9                hb2e6521_2    conda-forge
sdl                       1.2.68               h293081c_0    conda-forge
sdl2                      2.28.4               h77f46ba_0    conda-forge
setuptools                67.6.1             pyhd8ed1ab_0    conda-forge
simde                     0.7.6                h00ab1b0_0    conda-forge
sip                       6.7.8           py310heca2aa9_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sleef                     3.5.1                h9b69904_2    conda-forge
smmap                     5.0.1                    pypi_0    pypi
snappy                    1.1.10               h9fff704_0    conda-forge
soxr                      0.1.3                h0b41bf4_3    conda-forge
spdlog                    1.11.0               h9b3ece8_1    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
svt-av1                   1.6.0                h59595ed_0    conda-forge
sympy                     1.12            pypyh9d50eac_103    conda-forge
sysroot_linux-64          2.12                he073ed8_15    conda-forge
tbb                       2021.10.0            h00ab1b0_2    conda-forge
tinyxml                   2.6.2                h4bd325d_2    conda-forge
tinyxml2                  9.0.0                h9c3ff4c_2    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tl-optional               1.1.0                hf52228f_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tomlplusplus              3.3.0                hcb278e6_0    conda-forge
tornado                   6.3             py310h1fa729e_0    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
trimesh                   3.21.5             pyhd8ed1ab_0    conda-forge
typing-extensions         4.5.0                hd8ed1ab_0    conda-forge
typing_extensions         4.5.0              pyha770c72_0    conda-forge
tzdata                    2023.3                   pypi_0    pypi
unicodedata2              15.0.0          py310h5764c6d_0    conda-forge
unixodbc                  2.3.10               h583eb01_0    conda-forge
urdf-parser-py            0.0.4                    pypi_0    pypi
urdfmodifiers             0.0.2                    pypi_0    pypi
urdfpy                    0.0.22             pyha21a80b_3    conda-forge
urllib3                   1.26.15            pyhd8ed1ab_0    conda-forge
visit_struct              1.0.0.1              hcb278e6_2    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
x264                      1!164.3095           h166bdaf_2    conda-forge
x265                      3.5                  h924138e_3    conda-forge
xcb-util                  0.4.0                hd590300_1    conda-forge
xcb-util-image            0.4.0                h8ee46fc_1    conda-forge
xcb-util-keysyms          0.4.0                h8ee46fc_1    conda-forge
xcb-util-renderutil       0.3.9                hd590300_1    conda-forge
xcb-util-wm               0.4.1                h8ee46fc_1    conda-forge
xkeyboard-config          2.38                 h0b41bf4_0    conda-forge
xorg-fixesproto           5.0               h7f98852_1002    conda-forge
xorg-inputproto           2.3.2             h7f98852_1002    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.1.1                hd590300_0    conda-forge
xorg-libsm                1.2.4                h7391055_0    conda-forge
xorg-libx11               1.8.6                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxcursor           1.2.0                h0b41bf4_1    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxfixes            5.0.3             h7f98852_1004    conda-forge
xorg-libxi                1.7.10               h7f98852_0    conda-forge
xorg-libxinerama          1.1.5                h27087fc_0    conda-forge
xorg-libxrandr            1.5.2                h7f98852_1    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-randrproto           1.5.0             h7f98852_1001    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xf86vidmodeproto     2.3.1             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yarp                      3.8.1                ha770c72_7    conda-forge
yarp-cxx                  3.8.1                h57bc1a5_7    conda-forge
yarp-python               3.8.1           py310h6c2f4e2_7    conda-forge
ycm-cmake-modules         0.15.1               hcb278e6_1    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               h166bdaf_4    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

@CarlottaSartore
Copy link
Contributor Author

I saw that even forcing the version of urdf parser py does not change the outcome, see https://github.com/CarlottaSartore/ADAM/actions/runs/6783418213. And the version is equal if the package is downloaded with pip or conda.

@CarlottaSartore
Copy link
Contributor Author

C.C. @traversaro @Nicogene

@traversaro
Copy link
Member

traversaro commented Nov 7, 2023

urdf-parser-py from PyPI is not supported by the urdf-parser-py's mantainers and containing a really old and unsupported version (see ros/urdf_parser_py#79 (comment) and ami-iit/adam#36). If you are already using conda, can you install urdf-parser-py from the urdfdom-py conda-forge package?

@CarlottaSartore
Copy link
Contributor Author

In my computer I have installed urdf-parser-py from pip so maybe is the conda installation that creates issues. I am trying now to replicate a fresh installation as the one of the CI to check where is the issue

@traversaro
Copy link
Member

This is an output of a CI (see https://github.com/CarlottaSartore/ADAM/actions/runs/6783258175),

Looking to the output here, the only error I see a lot of:

E   ModuleNotFoundError: No module named 'git'

I can't find the error that you mentioned in the original post.

@CarlottaSartore
Copy link
Contributor Author

I am able to replicate the error, the difference as @traversaro said is in using urdf-parser-py from pip (no error) or urdfdom-py and the error appears:

../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
../../../miniforge3/envs/ADAM_env/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
tests/parametric/test_CasADi_computations_parametric.py:58: in <module>
    comp = KinDynComputations(model_path, joints_name_list, root_link)
src/adam/casadi/computations.py:35: in __init__
    factory = URDFModelFactory(path=urdfstring, math=math)
src/adam/model/std_factories/std_model.py:24: in __init__
    self.urdf_desc = urdf_parser_py.urdf.URDF.from_xml_file(path)
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/urdf_parser_py/xml_reflection/core.py:617: in from_xml_file
    return cls.from_xml_string(xml_string)
../../../miniforge3/envs/ADAM_env/lib/python3.10/site-packages/urdf_parser_py/xml_reflection/core.py:610: in from_xml_string
    node = etree.fromstring(xml_string)
src/lxml/etree.pyx:3257: in lxml.etree.fromstring
    ???
src/lxml/parser.pxi:1911: in lxml.etree._parseMemoryDocument
    ???
E   ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.

@CarlottaSartore
Copy link
Contributor Author

This is an output of a CI (see https://github.com/CarlottaSartore/ADAM/actions/runs/6783258175),

Looking to the output here, the only error I see a lot of:

E   ModuleNotFoundError: No module named 'git'

I can't find the error that you mentioned in the original post.

Sorry, wrong CI, I was talking about this https://github.com/CarlottaSartore/ADAM/actions/runs/6783316462/job/18437290808#step:7:964

@traversaro
Copy link
Member

traversaro commented Nov 7, 2023

I was able to replicate the problem just with urdfdom-py:

mamba create -n urdfdom-py urdfdom-py
mamba activate urdfdom-py
wget https://raw.githubusercontent.com/icub-tech-iit/ergocub-gazebo-simulations/1179630a88541479df51ebb108a21865ea251302/models/stickBot/model.urdf
$CONDA_PREFIX/lib/urdfdom_py/display_urdf model.urdf

fails with:

Traceback (most recent call last):
  File "/home/traversaro/miniforge3/envs/urdfdom-py/lib/urdfdom_py/display_urdf", line 33, in <module>
    sys.exit(load_entry_point('urdfdom-py==1.2.1', 'console_scripts', 'display_urdf')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/traversaro/miniforge3/envs/urdfdom-py/lib/python3.12/site-packages/urdf_parser_py/display_urdf.py", line 15, in main
    robot = URDF.from_xml_string(args.file.read())
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/traversaro/miniforge3/envs/urdfdom-py/lib/python3.12/site-packages/urdf_parser_py/xml_reflection/core.py", line 610, in from_xml_string
    node = etree.fromstring(xml_string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/etree.pyx", line 3257, in lxml.etree.fromstring
  File "src/lxml/parser.pxi", line 1911, in lxml.etree._parseMemoryDocument
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.

mamba list:

(urdfdom-py) traversaro@IITICUBLAP257:~$ mamba list
# packages in environment at /home/traversaro/miniforge3/envs/urdfdom-py:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
ca-certificates           2023.7.22            hbcca054_0    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h807b86a_2    conda-forge
libgomp                   13.2.0               h807b86a_2    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libsqlite                 3.44.0               h2797004_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_2    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxml2                   2.11.5               h232c23b_1    conda-forge
libxslt                   1.1.37               h0054252_1    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lxml                      4.9.3           py312he528aba_1    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
openssl                   3.1.4                hd590300_0    conda-forge
pip                       23.3.1             pyhd8ed1ab_0    conda-forge
python                    3.12.0          hab00c5b_0_cpython    conda-forge
python_abi                3.12                    4_cp312    conda-forge
pyyaml                    6.0.1           py312h98912ed_1    conda-forge
readline                  8.2                  h8228510_1    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
urdfdom-py                1.2.1           py312h7900ff3_3    conda-forge
wheel                     0.41.3             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge

@traversaro
Copy link
Member

I think it is a problem in urdf_parser_py and/or adam, but anyhow just removing encoding='UTF-8' I guess should be safe.

@traversaro
Copy link
Member

I think it is a problem in urdf_parser_py and/or adam, but anyhow just removing encoding='UTF-8' I guess should be safe.

I opened the issue upstream in ros/urdf_parser_py#82, while I guess to solve the issue in our models we can just get rid of encoding='UTF-8' from the top of our XML files, that anyhow I guess are just using ASCII characters so the encoding is not particularly useful.

@CarlottaSartore
Copy link
Contributor Author

CarlottaSartore commented Nov 7, 2023

Yes I think also that removing

<?xml version='1.0' encoding='UTF-8'?>

should be enough (also because generally in icub-models we do not have it), the only problem is that this entry is automatically generated when saving the urdf file e.g.

Am I right ? @Nicogene

@traversaro
Copy link
Member

traversaro commented Nov 7, 2023

Argh, so this is a urdfpy/urchin (see https://github.com/fishbotics/urchin/blob/5a8068a9c6f4c0d43a57d6bdb4c9be52d9fd0549/urchin/urdf.py#L3714) + urdf_parser_py combined bug, great.

@traversaro
Copy link
Member

Probably a quick fix on our side (i.e. ergocub-gazebo-simulations) is to re-parse the xml read from filename, and re-export removing the encoding, i.e. with tree.write(file_obj, pretty_print=True, xml_declaration=True) or tree.write(file_obj, pretty_print=True, xml_declaration=False)?

@Nicogene
Copy link
Member

Nicogene commented Nov 7, 2023

Yes I think also that removing

<?xml version='1.0' encoding='UTF-8'?>

should be enough (also because generally in icub-models we do not have it), the only problem is that this entry is automatically generated when saving the urdf file e.g.

Am I right ? @Nicogene

I have not memory of this, I know that the stickbot has been created by hand by @AlexAntn and @GrmanRodriguez, but I don't know modify_robot.py adds it the encoding on top

@traversaro
Copy link
Member

I have not memory of this, I know that the stickbot has been created by hand by @AlexAntn and @GrmanRodriguez, but I don't know modify_robot.py adds it the encoding on top

No, the encoding is happening inside the urdfpy/urchin at the line https://github.com/fishbotics/urchin/blob/5a8068a9c6f4c0d43a57d6bdb4c9be52d9fd0549/urchin/urdf.py#L3714 . Another possible option is that adam removes the encoding line (or directly all the xml declaration line). That probably make also more sense as the bugged library (urdf_parser_py) is used on the adam side, so it make sense that the workaround is on that side.

@CarlottaSartore
Copy link
Contributor Author

Done in CarlottaSartore/ADAM@5bec824, now the CI passes.

What do we want to do with this issue then?

@traversaro
Copy link
Member

What do we want to do with this issue then?

I think we can close it. An XML file that starts with <?xml version='1.0' encoding='UTF-8'?> is perfectly legal from the XML point of view, and urdf_parser_py should be able to handle that, and that is a bug that is tracked in ros/urdf_parser_py#82 .

@CarlottaSartore
Copy link
Contributor Author

Closing this issue then! Thanks everybody !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants