Figuring out installed ignition gazebo version inside launch file

asked 2022-11-04 05:44:26 -0500

ijnek gravatar image

updated 2022-11-04 05:44:40 -0500

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'
    config = 'gui-fortress.config'

gui_config_arg = DeclareLaunchArgument(
    description='Path to the GUI config file to open.',
        [FindPackageShare('my_robot'), 'configs', config]))
edit retag flag offensive close merge delete