ADVRHumanoids / iit-centauro-ros-pkg

2 stars 1 forks source link

Centauro URDF fails to be built #15

Closed lia2790 closed 3 years ago

lia2790 commented 3 years ago

Problem

I fail generating the centauro URDF model. In particular I get the following output from terminal

liana@liana-MS-7820 ~/Downloads/iit-centauro-ros-pkg-master/centauro_urdf/script $ ./create_urdf_srdf_sdf.sh centauro
Robot Name is centauro
Regenerating database.config for centauro_gazebo
Processing file config/centauro.urdf.xacro
Traceback (most recent call last):
  File "../script/get_model_params.py", line 5, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4
Traceback (most recent call last):
  File "../script/get_model_params.py", line 5, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4
centauro configures model , version 
Creating bare urdf of centauro.urdf.xacro ...
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/liana/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ROS path [3]=/opt/xbot/share
when processing file: centauro.urdf.xacro
...centauro.urdf correctly created!

Creating capsule urdf of centauro.urdf.xacro ...
./create_urdf_srdf_sdf.sh: line 88: robot_capsule_urdf: command not found
...centauro_capsules.urdf correctly created!

Creating sdf of centauro_robot.urdf.xacro
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/liana/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ROS path [3]=/opt/xbot/share
when processing file: centauro_robot.urdf.xacro
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/liana/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ROS path [3]=/opt/xbot/share
when processing file: centauro_robot.urdf.xacro
Error [parser.cc:340] Error parsing XML in file [centauro_robot.urdf]: Error document empty.
Error: SDF parsing the xml failed
 changing centauro_robot.urdf name to _centauro_robot.urdf
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/liana/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ROS path [3]=/opt/xbot/share
when processing file: centauro_robot.urdf.xacro
...sdf correctly created!

Installing robot model in centauro_gazebo/centauro

Creating srdf from centauro.srdf.xacro
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/liana/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ROS path [3]=/opt/xbot/share
when processing file: centauro.srdf.xacro
...created centauro.srdf!

Creating capsule srdf of centauro.srdf.xacro ...
...centauro_capsules.srdf correctly created!

Traceback (most recent call last):
  File "./load_acm.py", line 42, in <module>
    srdf = minidom.parse(args.srdf_file.name)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: no element found: line 1, column 0
Traceback (most recent call last):
  File "./load_acm.py", line 42, in <module>
    srdf = minidom.parse(args.srdf_file.name)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: no element found: line 1, column 0
skipping computation of default allowed collision detection matrix
Please make sure the ACM are up-to-date by running make acm in the model build folder

Complete! Enjoy  ver  in GAZEBO!

Creating capsule urdf (for visualization) of centauro_capsules.urdf ...
./create_urdf_srdf_sdf.sh: line 159: robot_capsule_urdf_to_rviz: command not found
...centauro_capsules.rviz correctly created! You can use view it by calling roslaunch centauro_urdf centauro_capsules_slider.launch

when I run

./create_urdf_srdf_sdf.sh centauro

inside the script folder of the package.

I saw that at the beginning I get an import error as below:

ImportError: No module named bs4

I tried to fix it but without success. How can I solve it? thank you in advance.

@EnricoMingo @alaurenzi @liesrock

liesrock commented 3 years ago

Did you source the devel/setup.bash of the package?

alaurenzi commented 3 years ago

Maybe missing the beautifulsoup package? Something link pip install bs4 should do the trick

lia2790 commented 3 years ago

Hi, thanks to answer! then as Luca told me yesterday, I should put iit-centauro-ros-pkg inside my catkin workspace. Before I run the script without having package inside it. Now, I did it. Therefore, now when I run catkin_make I got the following output on the terminal ( I do not if it is correct or not)

liana@liana-MS-7820 ~/catkin_ws $ catkin_make
Base path: /home/liana/catkin_ws
Source space: /home/liana/catkin_ws/src
Build space: /home/liana/catkin_ws/build
Devel space: /home/liana/catkin_ws/devel
Install space: /home/liana/catkin_ws/install
####
#### Running command: "cmake /home/liana/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/liana/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/liana/catkin_ws/install -G Unix Makefiles" in "/home/liana/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/liana/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic;/opt/xbot
-- This workspace overlays: /opt/ros/melodic;/opt/xbot
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/liana/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 8 packages in topological order:
-- ~~  - cartesio_tests_cpp
-- ~~  - cartesio_tests_quickstart
-- ~~  - cartesio_tests_rosclient
-- ~~  - centauro_cartesio_config
-- ~~  - centauro_urdf
-- ~~  - centauro_srdf
-- ~~  - variable_impedance_regulation
-- ~~  - centauro_gazebo
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'cartesio_tests_cpp'
-- ==> add_subdirectory(CartesioTests/CartesioTestsCpp)
-- +++ processing catkin package: 'cartesio_tests_quickstart'
-- ==> add_subdirectory(CartesioTests/CartesioTestsQuickStart)
-- +++ processing catkin package: 'cartesio_tests_rosclient'
-- ==> add_subdirectory(CartesioTests/CartesioTestsROSClient)
-- +++ processing catkin package: 'centauro_cartesio_config'
-- ==> add_subdirectory(iit-centauro-ros-pkg/centauro_cartesio_config)
-- +++ processing catkin package: 'centauro_urdf'
-- ==> add_subdirectory(iit-centauro-ros-pkg/centauro_urdf)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'centauro_srdf'
-- ==> add_subdirectory(iit-centauro-ros-pkg/centauro_srdf)
-- +++ processing catkin package: 'variable_impedance_regulation'
-- ==> add_subdirectory(VariableImpedanceRegulation)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Warning at /home/liana/catkin_ws/build/VariableImpedanceRegulation/cmake/variable_impedance_regulation-genmsg.cmake:3 (message):
  Invoking generate_messages() without having added any message or service
  file before.

  You should either add add_message_files() and/or add_service_files() calls
  or remove the invocation of generate_messages().
Call Stack (most recent call first):
  /opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
  VariableImpedanceRegulation/CMakeLists.txt:76 (generate_messages)

-- variable_impedance_regulation: 0 messages, 0 services
-- +++ processing catkin package: 'centauro_gazebo'
-- ==> add_subdirectory(iit-centauro-ros-pkg/centauro_gazebo)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/liana/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/liana/catkin_ws/build"
####
Robot Name is centauro
Regenerating database.config for centauro_gazebo
/home/liana/catkin_ws/src/iit-centauro-ros-pkg/centauro_urdf/script/create_urdf_srdf_sdf.sh: line 35: ../../centauro_gazebo/database/database.config: No such file or directory
Processing file config/centauro.urdf.xacro
Traceback (most recent call last):
  File "../script/get_model_params.py", line 5, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4
[  6%] Built target VariableImpedanceConfiguration
Traceback (most recent call last):
  File "../script/get_model_params.py", line 5, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4
centauro configures model , version 
[ 12%] Built target CartesioTestsROSClientHandler
[ 19%] Built target CartesioTestsHandler
Creating bare urdf of centauro.urdf.xacro ...
[ 25%] Built target VariableImpedanceController
[ 38%] Built target VariableImpedanceRobot
[ 38%] Built target Printer
[ 45%] Built target Logger
[ 51%] Built target VariableImpedancePlanner
[ 58%] Built target Publisher
[ 58%] Built target std_msgs_generate_messages_eus
[ 58%] Built target std_msgs_generate_messages_lisp
[ 58%] Built target std_msgs_generate_messages_nodejs
[ 58%] Built target std_msgs_generate_messages_cpp
[ 58%] Built target std_msgs_generate_messages_py
[ 64%] Built target CartesioTestsManager
[ 70%] Built target CartesioTestsROSClientManager
[ 77%] Built target VariableImpedanceRegulationManager
[ 77%] Built target variable_impedance_regulation_generate_messages_nodejs
[ 80%] Built target variable_impedance_regulation_generate_messages_eus
[ 80%] Built target variable_impedance_regulation_generate_messages_lisp
[ 80%] Built target variable_impedance_regulation_generate_messages_cpp
[ 80%] Built target variable_impedance_regulation_generate_messages_py
[ 87%] Built target CartesioTestsCpp
[ 93%] Built target VariableImpedanceRegulation
[100%] Built target CartesioTestsROSClient
[100%] Built target variable_impedance_regulation_generate_messages
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
ROS path [2]=/opt/xbot/share
ROS path [3]=/opt/xbot/lib
when processing file: centauro.urdf.xacro
...centauro.urdf correctly created!

Creating capsule urdf of centauro.urdf.xacro ...
/home/liana/catkin_ws/src/iit-centauro-ros-pkg/centauro_urdf/script/create_urdf_srdf_sdf.sh: line 88: robot_capsule_urdf: command not found
...centauro_capsules.urdf correctly created!

Creating sdf of centauro_robot.urdf.xacro
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
ROS path [2]=/opt/xbot/share
ROS path [3]=/opt/xbot/lib
when processing file: centauro_robot.urdf.xacro
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
ROS path [2]=/opt/xbot/share
ROS path [3]=/opt/xbot/lib
when processing file: centauro_robot.urdf.xacro
Error [parser.cc:340] Error parsing XML in file [centauro_robot.urdf]: Error document empty.
Error: SDF parsing the xml failed
 changing centauro_robot.urdf name to _centauro_robot.urdf
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
ROS path [2]=/opt/xbot/share
ROS path [3]=/opt/xbot/lib
when processing file: centauro_robot.urdf.xacro
...sdf correctly created!

Installing robot model in centauro_gazebo/centauro

Creating srdf from centauro.srdf.xacro
resource not found: centauro_urdf
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
ROS path [2]=/opt/xbot/share
ROS path [3]=/opt/xbot/lib
when processing file: centauro.srdf.xacro
...created centauro.srdf!

Creating capsule srdf of centauro.srdf.xacro ...
...centauro_capsules.srdf correctly created!

Traceback (most recent call last):
  File "./load_acm.py", line 42, in <module>
    srdf = minidom.parse(args.srdf_file.name)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: no element found: line 1, column 0
Traceback (most recent call last):
  File "./load_acm.py", line 42, in <module>
    srdf = minidom.parse(args.srdf_file.name)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: no element found: line 1, column 0
skipping computation of default allowed collision detection matrix
Please make sure the ACM are up-to-date by running make acm in the model build folder

Complete! Enjoy  ver  in GAZEBO!

Creating capsule urdf (for visualization) of centauro_capsules.urdf ...
/home/liana/catkin_ws/src/iit-centauro-ros-pkg/centauro_urdf/script/create_urdf_srdf_sdf.sh: line 159: robot_capsule_urdf_to_rviz: command not found
...centauro_capsules.rviz correctly created! You can use view it by calling roslaunch centauro_urdf centauro_capsules_slider.launch

[100%] Built target compile_urdf_sdf

It seems that the urdf had been built without to run the script... then if I check the robot urdf I see that the file centauro.urdf has been created but empty. Instead, if I run

source devel/setup.sh

before to run catkin_make (as Luca suggested) I obtain an no-empty centauro.urdf file and on my terminal I have the following output

liana@liana-MS-7820 ~/catkin_ws $ catkin_make
Base path: /home/liana/catkin_ws
Source space: /home/liana/catkin_ws/src
Build space: /home/liana/catkin_ws/build
Devel space: /home/liana/catkin_ws/devel
Install space: /home/liana/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/liana/catkin_ws/build"
####
####
#### Running command: "make -j4 -l4" in "/home/liana/catkin_ws/build"
####
Robot Name is centauro
Regenerating database.config for centauro_gazebo
Processing file config/centauro.urdf.xacro
[  6%] Built target VariableImpedanceConfiguration
Traceback (most recent call last):
  File "../script/get_model_params.py", line 5, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4
[ 12%] Built target CartesioTestsHandler
[ 19%] Built target CartesioTestsROSClientHandler
Traceback (most recent call last):
  File "../script/get_model_params.py", line 5, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4
centauro configures model , version 
[ 25%] Built target VariableImpedanceController
Creating bare urdf of centauro.urdf.xacro ...
[ 32%] Built target Printer
[ 38%] Built target VariableImpedanceRobot
[ 45%] Built target Logger
[ 51%] Built target VariableImpedancePlanner
[ 58%] Built target Publisher
[ 58%] Built target std_msgs_generate_messages_nodejs
[ 58%] Built target std_msgs_generate_messages_eus
[ 58%] Built target std_msgs_generate_messages_lisp
[ 58%] Built target std_msgs_generate_messages_cpp
[ 58%] Built target std_msgs_generate_messages_py
[ 64%] Built target CartesioTestsManager
[ 70%] Built target VariableImpedanceRegulationManager
[ 77%] Built target CartesioTestsROSClientManager
[ 77%] Built target variable_impedance_regulation_generate_messages_nodejs
[ 80%] Built target variable_impedance_regulation_generate_messages_eus
[ 80%] Built target variable_impedance_regulation_generate_messages_lisp
[ 80%] Built target variable_impedance_regulation_generate_messages_cpp
[ 80%] Built target variable_impedance_regulation_generate_messages_py
[ 87%] Built target CartesioTestsCpp
[ 93%] Built target CartesioTestsROSClient
[ 93%] Built target variable_impedance_regulation_generate_messages
[100%] Built target VariableImpedanceRegulation
...centauro.urdf correctly created!

Creating capsule urdf of centauro.urdf.xacro ...
/home/liana/catkin_ws/src/iit-centauro-ros-pkg/centauro_urdf/script/create_urdf_srdf_sdf.sh: line 88: robot_capsule_urdf: command not found
...centauro_capsules.urdf correctly created!

Creating sdf of centauro_robot.urdf.xacro
 changing centauro_robot.urdf name to _centauro_robot.urdf
...sdf correctly created!

Installing robot model in centauro_gazebo/centauro

Creating srdf from centauro.srdf.xacro
...created centauro.srdf!

Creating capsule srdf of centauro.srdf.xacro ...
...centauro_capsules.srdf correctly created!

Traceback (most recent call last):
  File "./load_acm.py", line 48, in <module>
    raise Exception('ERROR: could not find acm file')
Exception: ERROR: could not find acm file
Traceback (most recent call last):
  File "./load_acm.py", line 48, in <module>
    raise Exception('ERROR: could not find acm file')
Exception: ERROR: could not find acm file
skipping computation of default allowed collision detection matrix
Please make sure the ACM are up-to-date by running make acm in the model build folder

Complete! Enjoy  ver  in GAZEBO!

Creating capsule urdf (for visualization) of centauro_capsules.urdf ...
/home/liana/catkin_ws/src/iit-centauro-ros-pkg/centauro_urdf/script/create_urdf_srdf_sdf.sh: line 159: robot_capsule_urdf_to_rviz: command not found
...centauro_capsules.rviz correctly created! You can use view it by calling roslaunch centauro_urdf centauro_capsules_slider.launch

[100%] Built target compile_urdf_sdf

Therefore, has the urdf been built like this or I still have to run the script? And, what should I do with the output that says:

Traceback (most recent call last):
  File "./load_acm.py", line 48, in <module>
    raise Exception('ERROR: could not find acm file')
Exception: ERROR: could not find acm file
Traceback (most recent call last):
  File "./load_acm.py", line 48, in <module>
    raise Exception('ERROR: could not find acm file')
Exception: ERROR: could not find acm file
skipping computation of default allowed collision detection matrix
Please make sure the ACM are up-to-date by running make acm in the model build folder

?

many thanks in advance!

liesrock commented 3 years ago

Yes the package needs to know where the centauro_urdf is in the ROS world so the first source is mandatory.

The rest of the errors printed are just warning: you can check the successful creation of the urdf/srdf/sdf in the related subfolders.

lia2790 commented 3 years ago

ok! thank you!