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

ROS2 ament_cmake_librariesConfig.cmake "include could not load file: "

asked 2021-04-28 04:10:02 -0500

rover_challenger gravatar image

updated 2021-04-29 17:02:48 -0500

jayess gravatar image

I have recently installed ROS2 on my ubuntu 20.04 machine. I initially was doing the simple publisher tutorial with rclcpp and had no issues with cmake what so ever. Once I tried to add a subscriber in my package and the subsequent cmake to support it I keep getting this weird error. I included my cmakelist.txt and the error output - sorry for the bad format - not soo sure how to format this stuff. (I also made sure to source setup my environment)


Starting >>> first_package
--- stderr: first_package
CMake Error at /home/niiquaye/ros2_foxy_training/install/ament_cmake_libraries/share/ament_cmake_libraries/cmake/ament_cmake_librariesConfig.cmake:41 (include):
  include could not find load file:

    /home/niiquaye/ros2_foxy_training/install/ament_cmake_libraries/share/ament_cmake_libraries/cmake/ament_cmake_libraries-extras.cmake
Call Stack (most recent call first):
  /home/niiquaye/ros2_foxy_training/install/ament_cmake/share/ament_cmake/cmake/ament_cmake_export_dependencies-extras.cmake:5 (find_package)
  /home/niiquaye/ros2_foxy_training/install/ament_cmake/share/ament_cmake/cmake/ament_cmakeConfig.cmake:41 (include)
  CMakeLists.txt:19 (find_package)

CMakeLists.txt

make_minimum_required(VERSION 3.5)
project(first_package)

if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99) 
endif()

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_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)

add_executable(talker src/publisher_member_function.cpp)
ament_target_dependencies(talker rclcpp std_msgs)

add_executable(listener src/subscriber_member_function.cpp)
ament_target_dependencies(listener rclcpp std_msgs)

install(TARGETS
        talker
        listener
        DESTINATION lib/${PROJECT_NAME})

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
endif()


ament_package()

I made sure to source setup my terminal

edit retag flag offensive close merge delete

Comments

Welcome to ROS Answers! Most regular markdown works here, so you can format blocks of code or blocks of terminal output by putting them between three backticks:

```
some code here
```

Or indent the blocks with 4 spaces. That's also what happens if you click the 'preformatted text' button in the toolbar of the editor (the one with the 1s and 0s on it)

sgvandijk gravatar image sgvandijk  ( 2021-04-28 12:07:35 -0500 )edit

Thank you!

rover_challenger gravatar image rover_challenger  ( 2021-04-29 13:43:51 -0500 )edit

@sgvandijk I've found that using the three backticks quite often still results in unreadable text and just use the preformatted text button which works well most of the time (at least more often than any other method)

jayess gravatar image jayess  ( 2021-04-29 17:04:27 -0500 )edit

Actually I found the same just after posting that yeah... the three backticks don't work well. Best is to use 4 spaces of indentation for each line of the block, which is what the preformatted text button does.

sgvandijk gravatar image sgvandijk  ( 2021-04-30 04:49:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-28 04:15:00 -0500

rover_challenger gravatar image

Nevermind was runninf colcon build in the wrong place ...... not like catkin build where you can run from everywhere

edit flag offensive delete link more

Comments

can you accept your own answer? just to close this out

christophebedard gravatar image christophebedard  ( 2021-04-30 15:14:19 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-04-28 04:10:02 -0500

Seen: 401 times

Last updated: Apr 29 '21