Colcon build error in px4_ros_com package for ros2 humble on ubuntu 22.04

571 views Asked by At

As specified in the title I am trying to build px4_ros_com for ros2 humble. I went through the px4 tutorial and followed it pretty closely, however when I colcon build px4_ros_com I get the following error

CMake Error at /home/XXXX/px4_ros_com_ros2/install/px4_msgs/share/px4_msgs/cmake/ament_cmake_export_targets-extras.cmake:18 (message):
  Failed to find exported target names in
  '/home/XXXX/px4_ros_com_ros2/install/px4_msgs/share/px4_msgs/cmake/export_px4_msgs__rosidl_generator_cExport.cmake'
Call Stack (most recent call first):
  /home/XXXX/px4_ros_com_ros2/install/px4_msgs/share/px4_msgs/cmake/px4_msgsConfig.cmake:41 (include)
  CMakeLists.txt:24 (find_package)

Any help would be appreciated!

I made sure of the following:

  • Fast-RTPS-Gen is version 1.0.4
  • Java version is 11.0.17
  • ros2 is sourced
1

There are 1 answers

0
ijnek On

This was a bug in ament_cmake that was fixed in the most recent version of ament_cmake (1.3.3).

Make sure you upgrade your packages with:

apt update
apt upgrade

After upgrading, check your ament_cmake version with:

ros2 pkg xml ament_cmake | grep version

If you see the following, or a newer version, this bug should be fixed:

<version>1.3.3</version>