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

Compilation error building against binary Bouncy: could not find FastRTPS

asked 2018-07-05 15:13:15 -0500

amosteo gravatar image

I'm building a few packages against the new Bouncy release and I'm seeing a difference between a binary installation and another one from source. Namely, when I source the installation from source my package builds normally, but when I source the binary one it hits an error. I'm on Ubuntu 18.04.

The error happens in a call to rosidl_generate_interfaces:

rosidl_generate_interfaces(${PROJECT_NAME}
        msg/Test.msg
        srv/Test.srv
        DEPENDENCIES std_msgs)

The error is:

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/bouncy/share/fastrtps_cmake_module/cmake/Modules/FindFastRTPS.cmake:95 (find_package_handle_standard_args)
/opt/ros/bouncy/share/rmw_fastrtps_cpp/cmake/rmw_fastrtps_cpp-extras.cmake:20 (find_package)
/opt/ros/bouncy/share/rmw_fastrtps_cpp/cmake/rmw_fastrtps_cppConfig.cmake:30 (include)
/opt/ros/bouncy/share/rmw_implementation_cmake/cmake/call_for_each_rmw_implementation.cmake:61 (find_package)
/opt/ros/bouncy/share/rosidl_generator_py/cmake/rosidl_generator_py_get_typesupports.cmake:26 (call_for_each_rmw_implementation)
/opt/ros/bouncy/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:27 (rosidl_generator_py_get_typesupports) /opt/ros/bouncy/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:38 (include)
/opt/ros/bouncy/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:169 (ament_execute_extensions)
CMakeLists.txt:69 (rosidl_generate_interfaces)

My sources can be found at https://github.com/ada-ros. The package causing the error is rosidl_generator_ada. It's quite possible I'm doing something wrong in the CMakeLists.txt/package.xml because I'm not entirely confident on my understanding of ROS2 dependency tags. Thanks for any help.

edit retag flag offensive close merge delete

Comments

For what is worth, after converting all the packages to ament_make build type, the error has gone away

amosteo gravatar image amosteo  ( 2018-07-06 07:24:05 -0500 )edit

Also I've prepared a small reproducer with the default output of ros2 pkg create . I've only added the minimal dependencies from my own package to reproduce the error. Here it is: https://github.com/mosteo/ros2_testcases

amosteo gravatar image amosteo  ( 2018-07-06 08:31:07 -0500 )edit

Please post your exact steps to reproduce your problem (without the need to guess what you are actually doing in which order).

Dirk Thomas gravatar image Dirk Thomas  ( 2018-07-06 12:57:34 -0500 )edit

From a brief look the example package doesn't declare the dependencies in the package manifest. See https://github.com/ros2/common_interf... for an example package with messages.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-07-06 12:58:08 -0500 )edit

Are you using colcon? If so, does the error persist after upgrading it?

sloretz gravatar image sloretz  ( 2018-07-06 15:50:23 -0500 )edit

@DirkThomas, I thought the .xml file wouldn't affect the compilation driven by CMake, if there are missing dependencies there that would be a real mistake on my part. The real case had all dependencies (I think). Adding the ones in your example to this testcase didn't help. Steps I followed: (cont.)

amosteo gravatar image amosteo  ( 2018-07-06 16:46:19 -0500 )edit
  • Create empty ws/src
    • Inside src, $ ros2 pkg create --build-type cmake fail
    • Copy my sample msg/srv to ~/ws/src/fail/
    • Created trivial ~/ws/src/fail/src/main.c
    • Filled CMakeLists.txt with minimal info.
    • Verify it builds with bouncy installed from srcs
    • Verify it fails with bouncy debs
amosteo gravatar image amosteo  ( 2018-07-06 16:56:08 -0500 )edit

Man, these comments are not the best! Anyway:

  • Both my bouncy binary/source installations are per wiki instructions
  • Before each build I open a new terminal, source the proper setup.bash, delete build and install folders

I just updated the testcase to add the deps in the xml, and (...)

amosteo gravatar image amosteo  ( 2018-07-06 16:58:38 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-06 17:44:59 -0500

Dirk Thomas gravatar image

updated 2018-07-18 11:31:17 -0500

The following patch to colcon-ros should fix the problem: colcon-ros#23 . Please try it again after updating the Debian package python3-colcon-ros to version 0.2.9-1.

Update:

With the above update the build works just fine for any existing message package, e.g. the common_interfaces repository.

In your case your test package uses plain CMake rather than ament_cmake. While that should work the problem is likely related to that difference.

Update 2:

The above patch only affects the build type ament_cmake but not plain cmake. You can workaround the problem by extending the CMAKE_PREFIX_PATH manually: export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH. An upcoming patch release of colcon-ros should be able to address this.

edit flag offensive delete link more

Comments

Sorry, same error after upgrading:

$ apt policy python3-colcon-ros 
python3-colcon-ros:
Installed: 0.2.9-1

$ which colcon
/usr/bin/colcon

$ rm -rf build install; colcon build

error in pastebin: https://pastebin.com/UCbSF67g

amosteo gravatar image amosteo  ( 2018-07-07 03:42:28 -0500 )edit

The error output is not sufficient to provide any help. How does the package fail_example look like? Do you have the FastRTPS Debian package installed (ros-bouncy-fastrtps)?

Dirk Thomas gravatar image Dirk Thomas  ( 2018-07-17 16:17:48 -0500 )edit

See here for a more complete sequence: https://pastebin.com/wnHpyxMM . This is in another computer, with freshly installed bouncy following debians instructions. You can find the repo for my test package in there. At the end of the sequence are the installed package versions.

amosteo gravatar image amosteo  ( 2018-07-18 04:12:55 -0500 )edit

Thanks for following through.

amosteo gravatar image amosteo  ( 2018-07-18 12:38:49 -0500 )edit
1

Should this still be a bug? python3-colcon-ros: Installed: 0.3.10-1 I'm building Ros in docker and I still have this issue but export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH before building fixes the issue.

Laas gravatar image Laas  ( 2019-05-22 08:45:07 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2018-07-05 15:13:15 -0500

Seen: 1,243 times

Last updated: Jul 18 '18