There happen to be changes in packages names between distros. Generally, I would like to keep my package.xml exactly the same and change given dependencies based on ROS distro. Hence, my question is if it is possible to distinguish distro based on something else than string, for example integer like with ROS_VERSION
environment variable.
My current idea is to use condition
field in package.xml to determinate the distro. Normally, it would be syntax like:
<exec_depend condition="$ROS_DISTRO == foxy">robot_state_publisher</exec_depend>
<exec_depend condition="$ROS_DISTRO == galactic">robot_state_broadcaster</exec_depend>
But let’s assume I created my package in times of Galactic and then Humble was released. There is some probability I will forget to add another hard-coded option for Humble in future and this will break builds. Assuming those packages won’t be changed in the future, it would be nice to use syntax such as:
<exec_depend condition="$ROS_DISTRO <= foxy">robot_state_publisher</exec_depend>
<exec_depend condition="$ROS_DISTRO >= galactic">robot_state_broadcaster</exec_depend>
The main problem is, that it is string-based comparison. Is there a way to check ROS distro as a numerical value?
Best regards,
Krzysztof Wojciechowski.