Figuring out installed ignition gazebo version inside launch file
I'm looking to support multiple ignition gazebo versions on a single branch, and I'd like to figure out which ignition gazebo version (ie. 'edifice', 'fortress', 'garden') is installed, to choose the appropriate gui configuration file as my configuration file is not compatible across multiple gazebo versions.
Is there a nice way to do something like the following from a ROS 2 python launch file?
if gz_version == 'edifice':
config = 'gui-edifice.config'
else:
config = 'gui-fortress.config'
gui_config_arg = DeclareLaunchArgument(
name='gui_config',
description='Path to the GUI config file to open.',
default_value=PathJoinSubstitution(
[FindPackageShare('my_robot'), 'configs', config]))