I am working on building a PX4-ROS2-Gazebo-YOLOv8 software stack from source. During this process, I am attempting to build a ROS 2 workspace as follows:
mkdir -p ./ws_sensor_combined/src/
cd ./ws_sensor_combined/src/
git clone https://github.com/PX4/px4_msgs.git
git clone https://github.com/PX4/px4_ros_com.git
cd ..
source /opt/ros/jazzy/setup.bash
colcon build
The issue arises during colcon build. Namely, the ‘px4_msgs’ package builds successfully but ‘px4_ros_com’ fails with this fatal error:
px4_ros_com repo have not been actively been maintained for PX4 (and px4_msgs) main branch. Do you have a particular need for it? I strongly suggest you to try the ROS 2 PX4 Interface library instead: PX4 ROS 2 Interface Library | PX4 Guide (main)
Your build is failing because the msgs definitions inpx4_msgs changed but the examples in px4_ros_com were not updated: sensor_gps got replaced with sensor_gnss.
Would you happen to know what the last branch of the px4_msgsgit project was that is compatible with px4_ros_com? I am following a set of instructions to setup a particular PX4-ROS2-Gazebo-YOLOv8 stack, as outlined here, that relies on the build succeeding, but that fails to pin the respective branches.
the repo you linked does not target a specific PX4 release but seeing that the last commit was 8 months ago, I’d suggest you to try and use v1.17.0:
use v1.17.0 for PX4 and px4_msgs and main for px4_ros_com.
Benja’s explanation points to the core issue: this is a version-skew problem, not a failed px4_msgs build.
If you need to reproduce that third-party stack exactly, I would pin all three moving parts explicitly:
PX4 release/tag
px4_msgs release/tag
px4_ros_com commit
rather than relying on main.
For example, if v1.17.0 is the compatibility point you choose, record the exact commit SHA of px4_ros_com that builds successfully with it as well. That makes the environment reproducible and prevents the same breakage later if main changes again.
I would also capture the failing and working combinations in a small compatibility table, e.g.:
PX4
px4_msgs
px4_ros_com
Result
main
main
main
fails: sensor_gps.hpp missing
v1.17.0
v1.17.0
main/known SHA
test
If the goal is long-term maintenance rather than reproducing the existing tutorial, migrating to px4-ros2-interface-lib is the cleaner path, as Benja suggested.
For tutorials that depend on multiple repos, pinning exact refs in the install instructions is important; otherwise a working setup can silently become unreproducible.