Closed BolunDai0216 closed 2 years ago
My CMakeLists.txt
file is:
cmake_minimum_required(VERSION 3.0.2)
project(franka_arm_ros)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(catkin REQUIRED COMPONENTS
controller_interface
dynamic_reconfigure
eigen_conversions
franka_gripper
franka_hw
geometry_msgs
hardware_interface
joint_limits_interface
pluginlib
realtime_tools
roscpp
tf
tf_conversions
urdf
visualization_msgs
)
find_package(Eigen3 REQUIRED)
find_package(pinocchio REQUIRED)
find_package(Franka 0.9.0 QUIET)
if(NOT Franka_FOUND)
find_package(Franka 0.8.0 REQUIRED)
endif()
catkin_package(
INCLUDE_DIRS include
LIBRARIES franka_arm_ros
CATKIN_DEPENDS controller_interface dynamic_reconfigure eigen_conversions franka_gripper franka_hw geometry_msgs hardware_interface joint_limits_interface pluginlib realtime_tools roscpp tf tf_conversions urdf visualization_msgs
DEPENDS Franka
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(franka_arm_ros_lib src/pd_controller.cpp)
target_link_libraries(franka_arm_ros_lib pinocchio::pinocchio ${catkin_LIBRARIES})
It seems that the compile definitions of Pinocchio are not taken into account. @wxmerkt or @nim65s Do you know why?
I put together an example on how to use Pinocchio in a ROS package here: https://github.com/wxmerkt/pinocchio_ros_example
Key is the following note from the README:
When including a ROS header, e.g. ros/ros.h, compilation errors may occur. This is due to different requirements for BOOST_MPL_LIMIT_LIST_SIZE between ROS and Pinocchio. To avoid this error, make sure to always include pinocchio/fwd.hpp before any other header.
Thanks for the quick answer @wxmerkt and the quick solution.
I put together an example on how to use Pinocchio in a ROS package here: https://github.com/wxmerkt/pinocchio_ros_example
Key is the following note from the README:
When including a ROS header, e.g. ros/ros.h, compilation errors may occur. This is due to different requirements for BOOST_MPL_LIMIT_LIST_SIZE between ROS and Pinocchio. To avoid this error, make sure to always include pinocchio/fwd.hpp before any other header.
Thanks for the quick response! After moving the header files on top it successfully compiled!
Hi,
I am trying to use pinocchio within a ROS package. When running
catkin_make --only-pkg-with-deps package_name
I get the following error:Would it be possible to help me take a look at this? My understanding of the build system is limited so I really appreciate any help. Thanks in advance!