Skip to content

Commit

Permalink
Merge pull request #223 from jessebloecker/master
Browse files Browse the repository at this point in the history
add config_path to subscribe.launch.py
  • Loading branch information
goldbattle authored Feb 9, 2022
2 parents 6d65547 + 0883223 commit 8170e57
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions ov_msckf/launch/subscribe.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
default_value="euroc_mav",
description="euroc_mav, tum_vi, rpng_aruco...",
),
DeclareLaunchArgument(
name="config_path",
default_value="",
description="path to estimator_config.yaml. If not given, determined based on provided 'config' above",
),
DeclareLaunchArgument(
name="verbosity",
default_value="INFO",
Expand All @@ -39,23 +44,32 @@


def launch_setup(context):
configs_dir = os.path.join(get_package_share_directory("ov_msckf"), "config")
available_configs = os.listdir(configs_dir)
config = LaunchConfiguration("config").perform(context)
if not config in available_configs:
return [
LogInfo(
msg="ERROR: unknown config: '{}' - Available configs are: {} - not starting OpenVINS".format(
config, ", ".join(available_configs)
config_path = LaunchConfiguration("config_path").perform(context)
if not config_path:
configs_dir = os.path.join(get_package_share_directory("ov_msckf"), "config")
available_configs = os.listdir(configs_dir)
config = LaunchConfiguration("config").perform(context)
if config in available_configs:
config_path = os.path.join(
get_package_share_directory("ov_msckf"),
"config",config,"estimator_config.yaml"
)
else:
return [
LogInfo(
msg="ERROR: unknown config: '{}' - Available configs are: {} - not starting OpenVINS".format(
config, ", ".join(available_configs)
)
)
)
]
config_path = os.path.join(
get_package_share_directory("ov_msckf"),
"config",
config,
"estimator_config.yaml",
)
]
else:
if not os.path.isfile(config_path):
return [
LogInfo(
msg="ERROR: config_path file: '{}' - does not exist. - not starting OpenVINS".format(
config_path)
)
]
node1 = Node(
package="ov_msckf",
executable="run_subscribe_msckf",
Expand Down

0 comments on commit 8170e57

Please sign in to comment.