Colcon Build Failed

I am having an issues getting the topics_25 tutorial to work in Unit 5. I get a colcon build failure:

user:~/ros2_ws$ colcon build --packages-select topics_25 console cohesion+
[0.255s] WARNING:colcon.colcon_core.package_selection:ignoring unknown package ‘console’ in --packages-select
[0.256s] WARNING:colcon.colcon_core.package_selection:ignoring unknown package ‘cohesion+’ in --packages-select
Starting >>> topics_25
— stderr: topics_25
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/opt/ros/foxy/share/fastrtps_cmake_module/cmake/Modules/FindFastRTPS.cmake:95 (find_package_handle_standard_args)
/opt/ros/foxy/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c-extras.cmake:7 (find_package)
/opt/ros/foxy/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_cConfig.cmake:41 (include)
/opt/ros/foxy/share/rosidl_typesupport_c/cmake/rosidl_typesupport_c-extras.cmake:13 (find_package)
/opt/ros/foxy/share/rosidl_typesupport_c/cmake/rosidl_typesupport_cConfig.cmake:41 (include)
/opt/ros/foxy/share/rosidl_default_runtime/cmake/rosidl_default_runtime-extras.cmake:12 (find_package)
/opt/ros/foxy/share/rosidl_default_runtime/cmake/rosidl_default_runtimeConfig.cmake:41 (include)
/opt/ros/foxy/share/builtin_interfaces/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/opt/ros/foxy/share/builtin_interfaces/cmake/builtin_interfacesConfig.cmake:41 (include)
/opt/ros/foxy/share/rcl_interfaces/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/opt/ros/foxy/share/rcl_interfaces/cmake/rcl_interfacesConfig.cmake:41 (include)
/opt/ros/foxy/share/rcl/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/opt/ros/foxy/share/rcl/cmake/rclConfig.cmake:41 (include)
/opt/ros/foxy/share/libstatistics_collector/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/opt/ros/foxy/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
/opt/ros/foxy/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/opt/ros/foxy/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
CMakeLists.txt:21 (find_package)


Failed <<< topics_25 [0.57s, exited with code 1]

Summary: 0 packages finished [0.74s]
1 package failed: topics_25
1 package had stderr output: topics_25

I copied the instructions exactly using copy and paste for the CMakeList.txt, but here it is:

cmake_minimum_required(VERSION 3.5)

project(topics_25)

Default to C99

if(NOT CMAKE_C_STANDARD)

set(CMAKE_C_STANDARD 99)

endif()

Default to C++14

if(NOT CMAKE_CXX_STANDARD)

set(CMAKE_CXX_STANDARD 14)

endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES “Clang”)

add_compile_options(-Wall -Wextra -Wpedantic)

endif()

find dependencies

find_package(ament_cmake REQUIRED)

find_package(rclcpp REQUIRED)

find_package(std_msgs REQUIRED)

find_package(builtin_interfaces REQUIRED)

find_package(rosidl_default_generators REQUIRED)

find_package(topics_25 REQUIRED)

if(BUILD_TESTING)

find_package(ament_lint_auto REQUIRED)

the following line skips the linter which checks for copyrights

remove the line when a copyright and license is present in all source files

#set(ament_cmake_copyright_FOUND TRUE)

the following line skips cpplint (only works in a git repo)

remove the line when this package is a git repo

#set(ament_cmake_cpplint_FOUND TRUE)

ament_lint_auto_find_test_dependencies()

endif()

rosidl_generate_interfaces(topics_25

“msg/Age.msg”

DEPENDENCIES builtin_interfaces

)

ament_package()

Any help would be appriciated.

Hello @JordanEssman,

welcome to the community!

The command you are invoking is is not properly formatted. You can run:

colcon build --packages-select topics_25

Or if you want to display output on the console after a package has finished you have to write:

colcon build --packages-select topics_25 --event-handlers console_cohesion+

With respect to this error:

Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)

I will have to look further into this issue, for the moment let me ping @albertoezquerro to get his opinion.

Cheers,

Roberto

Welcome Jordan! It is a pleasure to see new people onboard, the community just keeps growing.

Maybe you would like to check out the markdown guide so that you unlock the ability of making your posts neat and beautiful.

You can go from this:

Failed <<< topics_25 [0.57s, exited with code 1]

Summary: 0 packages finished [0.74s]
1 package failed: topics_25
1 package had stderr output: topics_25

I copied the instructions exactly using copy and paste for the CMakeList.txt, but here it is:

cmake_minimum_required(VERSION 3.5)

project(topics_25)

Default to C99

if(NOT CMAKE_C_STANDARD)

set(CMAKE_C_STANDARD 99)

endif()

To this:
Failed <<< topics_25 [0.57s, exited with code 1]

Summary: 0 packages finished [0.74s]
1 package failed: topics_25
1 package had stderr output: topics_25

I copied the instructions exactly using copy and paste for the CMakeList.txt, but here it is:

cmake_minimum_required(VERSION 3.5)

project(topics_25)

# Default to C99

if(NOT CMAKE_C_STANDARD)

set(CMAKE_C_STANDARD 99)

endif()
1 Like

This topic was automatically closed after 3 days. New replies are no longer allowed.