Ask Your Question
0

How to set CMake with Orocos-bfl in Ubuntu 18.04 - ROS Melodic

asked 2019-06-05 10:22:45 -0500

RayROS gravatar image

updated 2019-06-05 11:14:47 -0500

gvdhoorn gravatar image

Hello, I am building a project that required the use of Orocos-bfl. I read official documentation where it explains how to incluse Orocos-bfl into a CMake project. However without success. I also read this other source where it explains that it is not possible to build my own package against BFL. So despite trying different options I cannot make my CMake compile the project with Orocos-bfl inside my catkin_ws. See below the project tree structure I have so far and that I am trying to compile:

--catkin_ws 
     --src
         -- project A
         -- project B
         --pf_localization (this is the project that should use `orocos-bfl`)
             --ros_float
             --config
             --include
             --launch
             --src
                  --pf_node.cpp (which is my executable file)
             --urdf
             --CMakeLists.txt
             --package.xml

I think that CMake is not accepting how I am setting the orocos-bfl and I am attaching below the CMake file I am trying to compile:

cmake_minimum_required(VERSION 2.8.3)
project(ros_float)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

find_package(rosbag REQUIRED)
include_directories(${rosbag_INCLUDE_DIRS})
find_package(catkin REQUIRED COMPONENTS
  roscpp
  sensor_msgs
  std_msgs
  message_generation
)

find_package(PkgConfig)
pkg_check_modules(BFL REQUIRED orocos-bfl)
include_directories(${BFL_INCLUDE_DIRS}/bfl)
message("BFL include dirs:" ${BFL_INCLUDE_DIRS})
message("BFL library dirs:" ${BFL_LIBRARY_DIRS})

## Build ##

include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

message(WARNING ${BFL_INCLUDE_DIRS})

file(GLOB INCLUDES
    "include/${PROJECT_NAME}/*.h"
    "include/${PROJECT_NAME}/*.cpp"
    "include/${PROJECT_NAME}/*.hpp"
    )

message(WARNING ${BFL_INCLUDE_DIRS})
link_directories(${BFL_LIBRARY_DIRS})
add_executable(pf_node src/pf_node.cpp ${INCLUDES})
target_link_libraries(pf_node ${BFL_LIBRARIES})

Also, just to cross off a possible doubts, I added <build_depend>bfl</build_depend> on my package.xml file

The Error of the compiler is below:

CMake Error at /usr/local/share/cmake-3.13/Modules/FindPkgConfig.cmake:452 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/share/cmake-3.13/Modules/FindPkgConfig.cmake:622 (_pkg_check_modules_internal)
  pf_localization/ros_float/CMakeLists.txt:19 (pkg_check_modules)

Thank you for pointing in the right direction with this issue.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-18 05:39:55 -0500

RayROS gravatar image

I found out the solution to my question for anyone that has/could have the same problem and wanted to share it. After installing orocos-bfl from source for some reason that I still can't explain myself the CMake would not run and incur in continuous mistakes.

The solution was: sudo synaptics search for orocos-bfl and install it from there.

After restarting and updating no problems. So the CMake file I provided above is actually correct, but the installation had to be done from command line. I hope this was useful if anyone incur in the same problem.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-06-05 10:22:45 -0500

Seen: 87 times

Last updated: Jun 18