ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Cannot use FCL with ROS

asked 2018-05-18 07:52:29 -0500

jpde.lopes gravatar image

Hello!

I am trying to use FCL with an Octree to perform obstacle detection. I downloaded the source code of FCL from github and performed the installation instructions:

mkdir build
cd build
cmake ..

This, I think, created a folder in usr/local/include/fcl with the installed library inside.

Now it was required to access it with ROS. For that, I added:

find_package(fcl REQUIRED)
${fcl_INCLUDE_DIRS}
target_link_libraries(obstacleDetection ${catkin_LIBRARIES} ${OCTOMAP_LIBRARIES} ${fcl_LIBRARY_DIRS} ${FCL_LIBRARIES})

to my CMakeLists.txt file.

It compiles with catkin_make, but when I add

#include "fcl/shape/geometric_shapes.h"

, for example, to my obstacleDetection.h, it shows a lot of errors, such as:

In file included from /usr/include/c++/5/cstdint:35:0,
             from /usr/include/fcl/data_types.h:42,
             from /usr/include/fcl/math/vec_3f.h:42,
             from /usr/include/fcl/BV/AABB.h:42,
             from /usr/include/fcl/collision_object.h:43,
             from /usr/include/fcl/shape/geometric_shapes.h:42,
             from /home/jpdelopes/ros_ws/src/prjc/src/../include/PrecisionAgriculture/obstacleDetection.h:27,
             from /home/jpdelopes/ros_ws/src/prjc/src/obstacleDetection.cpp:6:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
(...)
/usr/include/fcl/data_types.h:48:14: error: ‘int64_t’ in namespace ‘std’ does not name a type
typedef std::int64_t  FCL_INT64;
(...)
In file included from /usr/include/fcl/collision_object.h:44:0,
             from /usr/include/fcl/shape/geometric_shapes.h:42,
             from /home/jpdelopes/ros_ws/src/prjc/src/../include/PrecisionAgriculture/obstacleDetection.h:27,
             from /home/jpdelopes/ros_ws/src/prjc/src/obstacleDetection.cpp:6:
/usr/include/fcl/math/transform.h:185:8: error: ‘mutex’ in namespace ‘std’ does not name a type
std::mutex lock_;

Which are three different errors. I think that the FCL library is detected, right? I do not know how to solve these errors.

PS: I think that I have installed all of the FCL library dependencies.

Thank you in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2018-05-18 08:47:57 -0500

gvdhoorn gravatar image

updated 2018-05-18 08:50:36 -0500

#error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

Newer FCL versions require C++11 support enabled. That is also what the error states.

You'll have to do this in the CMakeLists.txt of your package.

Some larger projects (such as MoveIt fi) do this by adding the following somewhere at the top of CMakeLists.txt:

add_definitions(-std=c++11)

Note that this should also be part already of your CMakeLists.txt, but commented.


Edit:

Now it was required to access it with ROS. For that, I added:

and just a quick note: none of this is ROS-specific. I keep repeating that in every question that deals with this kind of topic, but this is all basic CMake. The fact that you're creating a ROS package, and that you use catkin_make to build it does not change that.

You would have to do the exact same thing if you weren't using ROS.

edit flag offensive delete link more

Comments

Thank you for your answer. I will try the first part now. Regarding the cmake part, thanks for the clarification.

jpde.lopes gravatar image jpde.lopes  ( 2018-05-18 08:55:02 -0500 )edit

Thank you! It solved the error regarding the C++11.

jpde.lopes gravatar image jpde.lopes  ( 2018-05-18 09:08:16 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-18 07:52:29 -0500

Seen: 916 times

Last updated: May 18 '18