Closed PasMarra closed 3 months ago
Hi @PasMarra, do you get, by any chance, an error message also from cmake?
I think we also got the following errors at CMake-level:
CMake Error: Files to be generated by multiple different commands: "/home/user/yarp-devices-ros2/build/ament_cmake_environment_hooks/ament_prefix_path.dsv"
CMake Error: Files to be generated by multiple different commands: "/home/user/yarp-devices-ros2/build/ament_cmake_environment_hooks/library_path.dsv"
I have reproduced it again using also ros rolling
. I am start thinking the problem might be due to CMake
itself.
@xEnVrE thanks for the reply. I asked about cmake because I get the same exact error that you shown. The issue has definitely something to do with CMake because when I change the order in which the two ros2_interfaces_ws packages folders are added, the error that @PasMarra has shown is not triggered by yarp_control_msgs but by map2d_nws_ros2_msgs. I'll try to come up with a solution tomorrow.
Thanks again for opening this issue
Thanks a lot, that means that, meanwhile, as we only need yarp_control_msgs
, we can just disable the nav part and we should be able to continue?
That should work, yes.
Possibily related to https://github.com/ament/ament_cmake/issues/460 .
This is a regression related to https://github.com/ament/ament_cmake/pull/416, see also the related comment.
I proposed a fix upstream in ROS 2 Iron in https://github.com/ament/ament_cmake/pull/484 . However, even if it is accepted it would take some time to have it released as a .deb package, so we may want to find a workaround in the meanwhile.
@PasMarra @xEnVrE can you check if https://github.com/robotology/yarp-devices-ros2/pull/62 solves the problem? Remember to try it on a clean build, as otherwise the AMENT_CMAKE_ENVIRONMENT_PACKAGE_GENERATION
option is already initialized to ON
.
@traversaro I can check if it works, just the time to setup the docker container and I'll let you know!
Remember to try it on a clean build
Maybe it is a dumb question, is it ok if I remove the build folder of yarp-devices-ros2
to achieve that or do you mean something different ros2-wise?
If a standard build clean is what you meant, I have already tried it but I keep receiving the error:
-- Configuring done
CMake Error: Files to be generated by multiple different commands: "/home/user/yarp-devices-ros2/build/ament_cmake_environment_hooks/ament_prefix_path.dsv"
CMake Error: Files to be generated by multiple different commands: "/home/user/yarp-devices-ros2/build/ament_cmake_environment_hooks/library_path.dsv"
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
If a standard build clean is what you meant, I have already tried it but I keep receiving the error:
Yes, I mean removing the build directory (not make clean
). It is strange you still get the problem, what is the output of (please run in the build directory):
cat CMakeCache.txt | grep AMENT_CMAKE_ENVIRONMENT_PACKAGE_GENERATION
What I did was
rm -rf build
mkdir build
cd build
cmake ../
Then I get the errors above.
The output of what you asked is then:
AMENT_CMAKE_ENVIRONMENT_PACKAGE_GENERATION:BOOL=ON
Sorry, there was a stupid bug, can you try in a clean build updating after https://github.com/robotology/yarp-devices-ros2/pull/62/commits/10351e6a845641625766ffe6698ed4c0c1fcfe70 ?
Considering the last change I get
-- Configuring done
CMake Error: Files to be generated by multiple different commands: "/home/user/yarp-devices-ros2/build/ament_cmake_environment_hooks/ament_prefix_path.dsv"
CMake Error: Files to be generated by multiple different commands: "/home/user/yarp-devices-ros2/build/ament_cmake_environment_hooks/library_path.dsv"
-- Generating done
and
cat CMakeCache.txt | grep AMENT_CMAKE_ENVIRONMENT_PACKAGE_GENERATION
AMENT_CMAKE_ENVIRONMENT_PACKAGE_GENERATION:BOOL=OFF
You are right, my environment was dirty. I played a bit but I could not find an easy workaround.
The fix was merged upstream in https://github.com/ament/ament_cmake/pull/484. Looking at the history of iron syncs (see https://discourse.ros.org/tag/iron), I think we could expect the fix to land in .deb in a few weeks.
Thanks for the update @traversaro
The fix was merged upstream in ament/ament_cmake#484. Looking at the history of iron syncs (see https://discourse.ros.org/tag/iron), I think we could expect the fix to land in .deb in a few weeks.
Actually that was just a merge in rolling, the backport PR to iron got stuck: https://github.com/ament/ament_cmake/pull/487 .
The fix was merged upstream in ament/ament_cmake#484. Looking at the history of iron syncs (see https://discourse.ros.org/tag/iron), I think we could expect the fix to land in .deb in a few weeks.
Actually that was just a merge in rolling, the backport PR to iron got stuck: ament/ament_cmake#487 .
The PR was merged, and it was released in February: https://github.com/ament/ament_cmake/commit/ff9a01f13ceacb381b99a8dec2eafa321b5f34f9 and https://discourse.ros.org/t/patch-release-4-and-new-packages-for-iron-irwini-2024-02-09/36006, I think we can safely close this issue.
Closing as the issue was fixed upstream in ROS, feel free to re-open or open a new issue if some issue persist.
I am using
ros2 iron
onUbuntu 22.04
and I am having difficulties to build the devices.I am following the pure CMake-based installation instructions in https://github.com/robotology/yarp-devices-ros2#build-with-pure-cmake-commands.
The built stops with the following errors:
Is
ros2 iron
supported or should I use a different version of ros2? Or are the above errors due to something else?Thank you
cc @elandini84 @randaz81