Closed Rank-N-Tensor closed 6 months ago
i was able to fix it , by adding target_link_libraries(test_node pinocchio::pinocchio)
to my CmakeLists.txt. This can be found in https://github.com/wxmerkt/pinocchio_ros_example.
that said, i would appreciate any ROS2 specific inputs from the authors as the example is for ROS1.
Thank you.
Have you tried using the namespaced target pinocchio::pinocchio
in your call to ament_target_dependencies
?
The docs seem to indicate ament is supposed to take care of the includes and linking but it seems it didn't work here.
hello @ManifoldFR, thank you for your response. Do you mean this ament_target_dependencies(test_node rclcpp pinocchio::pinocchio)
?
If so , this is the output
ament_target_dependencies() the passed package name 'pinocchio::pinocchio'
was not found before
Call Stack (most recent call first):
CMakeLists.txt:42 (ament_target_dependencies)
please advise.
Okay, after a quick look around it seems ament_target_dependencies
was added to ROS2 before the advent of modern CMake namespaced targets (and using target_link_libraries
). There's a discussion about deprecating it right here: https://github.com/ament/ament_cmake/issues/292 since many packages use these new targets now (including Pinocchio).
I think the docs you looked at (and that I found) are just old and don't reflect how things work nowadays. The tl;dr is that ament_target_dependencies
is a vestigial abomination that you should ignore and use target_link_libraries
for everything instead when you can - it will handle includes and linking just like the CMake docs promise :)
@nim65s would you agree with my analysis?
Understood! thank you for this, I am glad i could learn something new today. Therefore, would you recommend something like this
add_executable(test_node src/IK_test.cpp)
ament_target_dependencies(test_node rclcpp)
target_link_libraries(test_node pinocchio::pinocchio)
? Or would you rather not use ament at all?
Understood! thank you for this, I am glad i could learn something new today. Therefore, would you recommend something like this
add_executable(test_node src/IK_test.cpp) ament_target_dependencies(test_node rclcpp) target_link_libraries(test_node pinocchio::pinocchio)
? Or would you rather not use ament at all?
It's better to use the modern CMake targets and target_link_libraries
for everything. rlcpp
does provide a modern CMake target so you should use it instead and banish that ament function to the shadow realm.
Closing as this is a problem with ROS2's maybe outdated docs and lack of deprecation
Bug description
the function computecollisions() cannot be called when writing code in c++. I understand that this is only available when pinocchio is built with HPP-FCL support, which is how it should be since its installed via ROS.
Expected behavior
Since It is installed via ROS(Humble) , it should come with HPP-FCL support and I should be able to call it.
Reproduction steps
Steps to reproduce the behavior:
Code
please see the code below
Additional context
this is my CmakeLists.txt file
and my package.xml
Furthermore, I do have pinocchio installed via robotpkg. I am not sure if that would cause a conflict.
System
Please help me and thank you for building such a great package, it is really useful!