Ask Your Question
0

Build of moveit from source fails in ROS Kinetic: FCL library errors

asked 2018-05-23 02:48:47 -0600

cschindlbeck gravatar image

updated 2018-05-23 03:18:32 -0600

Building moveit with catkin_make in ROS Kinetic (Ubuntu 16.04) fails with the following errors

/usr/local/include/fcl/math/constants.h:49:1: error: expected primary-expression before ‘static’
 static constexpr S pi() { return S(3.141592653589793238462643383279502884197169399375105820974944592L); }
 ^
/usr/local/include/fcl/math/constants.h:49:1: error: expected ‘}’ before ‘static’
/usr/local/include/fcl/math/constants.h:49:1: error: expected ‘;’ before ‘static’
/usr/local/include/fcl/math/constants.h:52:18: error: ‘S’ does not name a type
 static constexpr S phi() { return S(1.618033988749894848204586834365638117720309179805762862135448623L); }
                  ^
/usr/local/include/fcl/math/constants.h:55:20: error: ‘constants’ does not name a type
 using constantsf = constants<float>;
                    ^
/usr/local/include/fcl/math/constants.h:56:20: error: ‘constants’ does not name a type
 using constantsd = constants<double>;
                    ^
/usr/local/include/fcl/math/constants.h:58:1: error: expected declaration before ‘}’ token
 } // namespace fcl
 ^

Do i need to add any compiler flags to the CMakeLists?

# toplevel CMakeLists.txt for a catkin workspace
# catkin/cmake/toplevel.cmake

cmake_minimum_required(VERSION 2.8.3)

add_compile_options(-std=c++11)

set(CATKIN_TOPLEVEL TRUE)

# search for catkin within the workspace
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${_cmd}
  RESULT_VARIABLE _res
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  OUTPUT_STRIP_TRAILING_WHITESPACE
  ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
  # searching fot catkin resulted in an error
  string(REPLACE ";" " " _cmd_str "${_cmd}")
  message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
endif()

# include catkin from workspace or via find_package()
if(_res EQUAL 0)
  set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
  # include all.cmake without add_subdirectory to let it operate in same scope
  include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
  add_subdirectory("${_out}")

else()
  # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
  # or CMAKE_PREFIX_PATH from the environment
  if(NOT DEFINED CMAKE_PREFIX_PATH)
    if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
      string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
    endif()
  endif()

  # list of catkin workspaces
  set(catkin_search_path "")
  foreach(path ${CMAKE_PREFIX_PATH})
    if(EXISTS "${path}/.catkin")
      list(FIND catkin_search_path ${path} _index)
      if(_index EQUAL -1)
        list(APPEND catkin_search_path ${path})
      endif()
    endif()
  endforeach()

  # search for catkin in all workspaces
  set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
  find_package(catkin QUIET
    NO_POLICY_SCOPE
    PATHS ${catkin_search_path}
    NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  unset(CATKIN_TOPLEVEL_FIND_PACKAGE)

  if(NOT catkin_FOUND)
    message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
  endif()
endif()

catkin_workspace()

I guess this is related to https://gist.github.com/JeroenDM/bb79... and https://answers.ros.org/question/2791... and https://answers.ros.org/question/2916...

edit retag flag offensive close merge delete

Comments

Also: the CMakeLists.txt is the top-level one in a Catkin workspace. You should not change that.

gvdhoorn gravatar imagegvdhoorn ( 2018-05-23 04:10:05 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2018-05-23 04:09:43 -0600

gvdhoorn gravatar image

Did you make sure to checkout the correct version of FCL? For Kinetic, I believe that should be 0.5.0.

edit flag offensive delete link more

Comments

Indeed, i had 0.6.0 installed, reverting to 0.5.0 and installing fcl from source solved the problem, thanks!

cschindlbeck gravatar imagecschindlbeck ( 2018-05-23 06:57:06 -0600 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2018-05-23 02:48:47 -0600

Seen: 240 times

Last updated: May 23 '18