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

Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)

asked 2019-10-04 06:53:31 -0500

khassanov gravatar image

I'm attempt to build a package with a custom action, but it fails with an error Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES). Please find full colon output below.

Google points me out to this fix and with export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH it works. Is it an issue I have to report to some repository or it's something missed in my CMakeLists.txt or package.xml files?

$colcon build --packages-select my_package
Starting >>> my_package
--- stderr: my_package
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /opt/ros/dashing/share/fastrtps_cmake_module/cmake/Modules/FindFastRTPS.cmake:95 (find_package_handle_standard_args)
  /opt/ros/dashing/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c-extras.cmake:7 (find_package)
  /opt/ros/dashing/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_cConfig.cmake:38 (include)
  /opt/ros/dashing/share/rosidl_default_generators/cmake/rosidl_default_generators-extras.cmake:21 (find_package)
  /opt/ros/dashing/share/rosidl_default_generators/cmake/rosidl_default_generatorsConfig.cmake:38 (include)
  CMakeLists.txt:6 (find_package)


---
Failed   <<< my_package       [ Exited with code 1 ]

Summary: 0 packages finished [0.82s]
  1 package failed: my_package
  1 package had stderr output: my_package
edit retag flag offensive close merge delete

Comments

it's something missed in my CMakeLists.txt or package.xml files?

that would be difficult to determine, seeing as you don't show us either of those files.

But I don't believe this is a problem in your package, but in your environment.

You'll probably have to describe how you installed ROS, how you normally activate/setup your workspace and whether you get this error with all packages that try to build messages or just this particular one.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-04 07:57:53 -0500 )edit

Hi there, i encounted the same problem today, I saw your solution and solved my problem. Thanks.

it's something missed in my CMakeLists.txt or package.xml files?

I dont think so.
I have installed ROS2 binary and ROS2 source code in my PC.
Before i run the colcon build steps, i source the ROS2 binary path:source /opt/ros/dashing/setup.bash, then i check the AMENT_PREFIX_PATH and CMAKE_PREFIX_PATH variables.The AMENT_PREFIX_PATH=/opt/ros/dashing, while the CMAKE_PREFIX_PATH has empty value, so the colcon build was failed.
But if i source the ROS2 source code path source ~/ros2_ws/install/local_setup.bash, then the variable AMENT_PREFIX_PATH and CMAKE_PREFIX_PATH have the same value. so the problem may result from that you installed the ROS2 binary version.

Back to the point. what cause the difference between the above phenomenon. i still have no idea....

lobby gravatar image lobby  ( 2019-11-29 02:33:27 -0500 )edit

4 Answers

Sort by » oldest newest most voted
1

answered 2020-10-09 09:18:54 -0500

Dirk Thomas gravatar image

Please see https://github.com/ros2/rosidl_typesu... for a proper fix to this issue.

edit flag offensive delete link more
1

answered 2020-10-09 03:15:44 -0500

madmax gravatar image

updated 2020-10-09 03:16:58 -0500

My workaround is to add this in your .bashrc:

export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH

This way I don't need to change any project files.

You could also add the cmake path: ( but Ament already has all the cmake paths in my system )

export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH
edit flag offensive delete link more
1

answered 2020-09-01 10:17:43 -0500

anas9011 gravatar image

Since there's no answer, I might as well post a workaround based on this link from the official Intellij Support Forum.

You can add in your CMakeLists.txt before the find_package() macros the following:

set(FastRTPS_INCLUDE_DIR /opt/ros/foxy/include) 
set(FastRTPS_LIBRARY_RELEASE /opt/ros/foxy/lib/libfastrtps.so)
edit flag offensive delete link more
0

answered 2020-10-05 12:14:55 -0500

updated 2020-10-07 03:18:35 -0500

I had the same issue. In my case, that error message was because I wrote incorrectly a package.xml file of one of my custom packages.

I wrote something like the following:

<depend>mypackage</mypackage> (incorrect xml tag closing)

Then, when I tried to build using colcon I got "that error message": "NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)"

When I fixed the package.xml syntax issue the error disappeared.

edit flag offensive delete link more

Comments

Have you reported this somewhere?

gvdhoorn gravatar image gvdhoorn  ( 2020-10-05 14:42:50 -0500 )edit

Not yet. Where should I report that? Should I do that in the issues in the rrclcpp github project?

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2020-10-06 07:44:30 -0500 )edit

Well, in which file did you find the syntax error? In which package was that file located?

gvdhoorn gravatar image gvdhoorn  ( 2020-10-06 12:59:52 -0500 )edit

I may have not explained it correctly. The syntax error is in a package.xml file of one of my custom packages, so it is not in any repository. What I mean is that if you are getting "that error message" you may have written incorrectly your package.xml file (in your package).

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2020-10-06 13:43:40 -0500 )edit

Ah, that changes things. I had understood your post as "I found an error in the FastRTPS package manifest". That would have been something to report.

gvdhoorn gravatar image gvdhoorn  ( 2020-10-06 13:44:38 -0500 )edit

Correct. However, I would say that the error message was very disorienting and I spend a while there trying to figure out what was happening. I'd rather would have expected some explicit reference to the incorrect package.xml syntax for that kind of error.

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2020-10-07 13:55:47 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-10-04 06:53:31 -0500

Seen: 3,297 times

Last updated: Oct 09 '20