-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix libfranka linking #37
fix libfranka linking #37
Conversation
ping @BarisYazici |
not sure why you are having the linking issue in the franka_example_controllers. Everything seems to be fine in the CI build stage. What's exactly the error? |
…dapt-ros-2-humble-implementation to humble * commit '98f75fa0ba7b6721a65cced1b85db3677e5f2f22': modified Dockerfile to checkout certain libfranka version refactor: removed unused variables, updated rt-kernel-warning and minor changes changed franka_harware::Robot to use franka::Robot instead of franka::RobotInterface updated and reactivated franka_hardware unittests changed franka_hardware Robot class to use external control loop functionality in libfranka added missing dependency to franka_semantic_components
19ad49f
to
a3ca5e0
Compare
I am building libfranka as a CMake package of a colcon workspace. Does the CI pipeline use the manually built Debian package?
On
However, with the current libfranka (0.12.1) and the ROS node (0.1.4) I don't see the error any more. |
I also see that |
@BarisYazici What do you think about having a branch for the "legacy" Franka robots that use libfranka 0.9? |
This happens, because libfranka does not contain a colcon build --packages-up-to libfranka
colcon build |
I don't see how this is a race condition. If header files cannot be found, it means that they are not installed or their include dir has not been added, which can in newer CMake projects be done via Note, while this PR is against the |
You're absolutely right. WITHIN a CMakeLists.txt, it ensures finding and compiling dependencies in the right order, but frankalib has no package.xml, which could fix the compile order in colcon. Because of that and compiling frankalib needs quite some time is the reason, why other packages are compiled in parallel and fail, if frankalib is not being build, yet. Thats's the race condition. I tested the latest humble and your PR yesterday, that's why I promise you calling |
You are correct about the order of package compilation with colcon etc. But the issue I am facing is different from this. It would also appear with libfranka already installed in the workspace. Since I created this PR, the humble branch advanced and the issue I reported might not be valid any longer. However, I am still experiencing linking issues with libfranka which I have fixed on a different branch, which is only compatible with the "legacy" code based on the |
I reproduced the error using libfranka 0.9.2 and franka_ros2 v0.1.0, but found another source of the error. Building via colcon drops the # generated from ament_cmake_export_dependencies/cmake/ament_cmake_export_dependencies-extras.cmake.in
set(_exported_dependencies "franka_hardware;franka_msgs;hardware_interface;rclcpp_lifecycle") A minimal change is adding diff --git a/franka_semantic_components/CMakeLists.txt b/franka_semantic_components/CMakeLists.txt
index 9bc3bef..7e1ce8c 100644
--- a/franka_semantic_components/CMakeLists.txt
+++ b/franka_semantic_components/CMakeLists.txt
@@ -85,5 +85,5 @@ endif()
ament_export_include_directories(include)
ament_export_libraries(franka_semantic_components)
-ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
+ament_export_dependencies(Franka ${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
These are the commands I used to compile: mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
git clone --recursive https://github.com/frankaemika/libfranka.git -b 0.9.2 src/libfranka
git clone https://github.com/frankaemika/franka_ros2.git -b v0.1.0 src/franka_ros2
colcon build --packages-up-to libfranka
source install/setup.bash
# modify ~/ros2_ws/src/franka_ros2/franka_semantic_components/CMakeLists.txt as mentioned
colcon build Using libfranka as stand-alone build works without code modification, because the library is set up properly: mkdir ~/workspace
cd ~/workspace
git clone --recursive https://github.com/frankaemika/libfranka.git -b 0.9.2
cd libfranka
cmake -B build -S .
cd build
make -j$(nproc)
make install
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
git clone https://github.com/frankaemika/franka_ros2.git -b v0.1.0 src/franka_ros2
colcon build |
This is exactly what we did here: https://github.com/boschresearch/franka_ros2/tree/fer1/fix_libfranka_linking with a365e3e. There are linking issues with the |
Compiling the targets
franka_example_controllers_parameters
andfranka_robot_state_broadcaster_parameters
fails due to the missing linking to libfranka. This PR fixes the issue by linking the libfranka targetFranka::Franka
. This also makes sure that the include paths or correctly imported.