ADVRHumanoids / iit-centauro-ros-pkg

2 stars 0 forks source link

catkin_package_xml() package name 'centauro_srdf' does not match current PROJECT_NAME '_srdf' #33

Closed IoannisDadiotis closed 2 years ago

IoannisDadiotis commented 2 years ago

I am trying to build my workspace on my Ubuntu 20.04 machine and I am getting the following output:

idadiotis@IITAVR002DU001 ~/centauro_ws $ catkin build
----------------------------------------------------------------
Profile:                     default
Extending:          [cached] /opt/ros/noetic:/opt/xbot
Workspace:                   /home/idadiotis/centauro_ws
----------------------------------------------------------------
Build Space:        [exists] /home/idadiotis/centauro_ws/build
Devel Space:        [exists] /home/idadiotis/centauro_ws/devel
Install Space:      [unused] /home/idadiotis/centauro_ws/install
Log Space:          [exists] /home/idadiotis/centauro_ws/logs
Source Space:       [exists] /home/idadiotis/centauro_ws/src
DESTDIR:            [unused] None
----------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
----------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
----------------------------------------------------------------
Buildlisted Packages:        None
Skiplisted Packages:         None
----------------------------------------------------------------
Workspace configuration appears valid.
----------------------------------------------------------------
[build] Found '6' packages in 0.0 seconds.                                        
[build] Package table is up to date.                                              
Starting  >>> centauro_cartesio_config                                            
Starting  >>> centauro_config                                                     
Starting  >>> centauro_contact_detection                                          
Starting  >>> centauro_gazebo                                                     
Starting  >>> centauro_srdf                                                       
Starting  >>> centauro_urdf                                                       
Finished  <<< centauro_gazebo                           [ 0.1 seconds ]           
Finished  <<< centauro_contact_detection                [ 0.2 seconds ]           
Finished  <<< centauro_config                           [ 0.1 seconds ]           
Finished  <<< centauro_cartesio_config                  [ 0.1 seconds ]           
__________________________________________________________________________________
Errors     << centauro_urdf:check /home/idadiotis/centauro_ws/logs/centauro_urdf/build.check.005.log
CMake Warning (dev) at CMakeLists.txt:1 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkin_package_xml.cmake:54 (message):
  catkin_package_xml() package name 'centauro_urdf' in
  '/home/idadiotis/centauro_ws/src/iit-centauro-ros-pkg/centauro_urdf/package.xml'
  does not match current PROJECT_NAME '_urdf'.  You must call project() with
  the same package name before.
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:99 (catkin_package_xml)
  CMakeLists.txt:5 (catkin_package)

CMake Error in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.16)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".

make: *** [Makefile:908: cmake_check_build_system] Error 1
cd /home/idadiotis/centauro_ws/build/centauro_urdf; catkin build --get-env centauro_urdf | catkin env -si  /usr/bin/make cmake_check_build_system; cd -

..................................................................................
Failed     << centauro_urdf:check                       [ Exited with code 2 ]    
Failed    <<< centauro_urdf                             [ 0.5 seconds ]           
__________________________________________________________________________________
Errors     << centauro_srdf:check /home/idadiotis/centauro_ws/logs/centauro_srdf/build.check.005.log
CMake Warning (dev) at CMakeLists.txt:1 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkin_package_xml.cmake:54 (message):
  catkin_package_xml() package name 'centauro_srdf' in
  '/home/idadiotis/centauro_ws/src/iit-centauro-ros-pkg/centauro_srdf/package.xml'
  does not match current PROJECT_NAME '_srdf'.  You must call project() with
  the same package name before.
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:99 (catkin_package_xml)
  CMakeLists.txt:5 (catkin_package)

CMake Error in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.16)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".

make: *** [Makefile:334: cmake_check_build_system] Error 1
cd /home/idadiotis/centauro_ws/build/centauro_srdf; catkin build --get-env centauro_srdf | catkin env -si  /usr/bin/make cmake_check_build_system; cd -

..................................................................................
Failed     << centauro_srdf:check                       [ Exited with code 2 ]    
Failed    <<< centauro_srdf                             [ 0.5 seconds ]           
[build] Summary: 4 of 6 packages succeeded.                                       
[build]   Ignored:   None.                                                        
[build]   Warnings:  None.                                                        
[build]   Abandoned: None.                                                        
[build]   Failed:    2 packages failed.                                           
[build] Runtime: 0.8 seconds total. 

Notice that before catkin build, when I try to configure centauro_cartesio I get the folowing CMake Warning:

 CMake Warning (dev) at CMakeLists.txt:2 (project):
   Policy CMP0048 is not set: project() command manages VERSION variables.
   Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
   command to set the policy and suppress this warning.

   The following variable(s) would be set to empty:

     CMAKE_PROJECT_VERSION
     CMAKE_PROJECT_VERSION_MAJOR
     CMAKE_PROJECT_VERSION_MINOR
     CMAKE_PROJECT_VERSION_PATCH
 This warning is for project developers.  Use -Wno-dev to suppress it.

iit-centauro-ros-pkg is in master branch. @alaurenzi

alaurenzi commented 2 years ago

Apparently, catkin build isn't building the iit-centauro-ros-pkg as a whole (as plain cmake would do), but it is instead building all subprojects individually. This is probably causing the issue. Do you know of any way to avoid this, and build the root CMakeLists.txt instead?

IoannisDadiotis commented 2 years ago

catkin build does not seem to be the problem. I am getting the same error in a different workspace built by catkin_make.

alaurenzi commented 2 years ago

I think the behavior is the same. What if you try with plain cmake?

IoannisDadiotis commented 2 years ago

you mean building iit-centauro-ros-pkg before the rest of the workspace? Something like cmake <path-to-repo-iit-centauro-ros-pkg>?

IoannisDadiotis commented 2 years ago

I am trying proceeding with plain cmake as described in the readme file of iit-centauro-ros-pkg. After make generate I get:

make generate
[ 12%] Built target generate_urdf_centauro
[ 25%] Generating /home/idadiotis/test_ws/src/iit-centauro-ros-pkg/build/centauro_srdf/centauro.srdf ..

/bin/sh: 1: moveit_compute_default_collisions: not found
make[3]: *** [centauro_srdf/CMakeFiles/generate_srdf_centauro.dir/build.make:64: centauro_srdf/centauro.srdf] Error 127
make[3]: *** Deleting file 'centauro_srdf/centauro.srdf'
make[2]: *** [CMakeFiles/Makefile2:634: centauro_srdf/CMakeFiles/generate_srdf_centauro.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:290: CMakeFiles/generate.dir/rule] Error 2
make: *** [Makefile:223: generate] Error 2

Notice that I have git clone this package of our organization. Is it really the one missing? I am getting errors when trying to build this package, I can provide the output if requested.

IoannisDadiotis commented 2 years ago

As an alternative I have been trying to install everything through the forest tool in a new workspace. The commands I have followed are: Install forest and grow some basic packages:

[sudo] pip3 install hhcm-forest
mkdir my_ws && cd my_ws
forest init
forest add-recipes git@github.com:advrhumanoids/multidof_recipes.git
forest grow xbot2_examples
forest grow centauro_cartesio
forest grow cartesio_collision_support
source setup.bash

Clone and build iit-centauro-ros-pkg

cd src
git clone git@github.com:ADVRHumanoids/iit-centauro-ros-pkg.git
cd iit-centauro-ros-pkg
mkdir build && cd build
cmake ..
make generate

make generate gives me the following error:

idadiotis@IITAVR002DU001 ~/forest_ws/src/iit-centauro-ros-pkg/build (master)$ make generate
[ 12%] Generating /home/idadiotis/forest_ws/src/iit-centauro-ros-pkg/build/centauro_urdf/centauro.urdf ..
resource not found: centauro_urdf
ROS path [0]=/opt/ros/noetic/share/ros
ROS path [1]=/home/idadiotis/forest_ws/install/share
ROS path [2]=/home/idadiotis/forest_ws/install/lib
ROS path [3]=/home/idadiotis/forest_ws/ros_src
ROS path [4]=/home/idadiotis/forest_ws/install/share
ROS path [5]=/opt/ros/noetic/share
ROS path [6]=/opt/xbot/share
when processing file: /home/idadiotis/forest_ws/src/iit-centauro-ros-pkg/centauro_urdf/urdf/centauro.urdf.xacro
make[3]: *** [centauro_urdf/CMakeFiles/generate_urdf_centauro.dir/build.make:82: centauro_urdf/centauro.urdf] Error 2
make[2]: *** [CMakeFiles/Makefile2:445: centauro_urdf/CMakeFiles/generate_urdf_centauro.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:290: CMakeFiles/generate.dir/rule] Error 2
make: *** [Makefile:223: generate] Error 2
alaurenzi commented 2 years ago

So, generating urdf/srdf from xacro does require some dependencies in order to deal with, e.g., collision models. As of now, these dependencies are mandatory. On the other hand, the package does not need any build stage since the pre-generated urdf and srdf are already there.

The collision model pipeline, as I've just checked, does not compile anymore on focal due to some ROS libary changing its interface.. I'll look into it

IoannisDadiotis commented 2 years ago

Hi @alaurenzi ,

I think I have found a way to solve it. I just tried building iit-centauro-ros-pkg with:

ccmake <path to repo>
make -j install

(instead of cmake and make generate)

Notice that I configured cmake with the following:

CMAKE_BUILD_TYPE                 Release                                                           
CMAKE_INSTALL_PREFIX             /home/idadiotis/forest_ws/install

The repo is build and installed with no problems. Up to now I can load the robot in gazebo and run xbot2 with no problem.

I will come back or close the issue later if there are no problems.

IoannisDadiotis commented 2 years ago

Some info after discussion with @alaurenzi: