clearpathrobotics / clearpath_robot

BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

clearpath_diagnostics launch file does not work with other setup_paths #59

Open SteveMacenski opened 4 months ago

SteveMacenski commented 4 months ago

Please provide the following information:

    launch_diagnostics = IncludeLaunchDescription(
        PythonLaunchDescriptionSource([PathJoinSubstitution([
            FindPackageShare('clearpath_diagnostics'), 'launch', 'diagnostics.launch.py'])]),
        launch_arguments=[('setup_path', setup_path)],
        condition=UnlessCondition(use_simulation)
    )

Works, but for some reason I cannot get that setup path to be respected and I get errors in launch about no YAML can be found. After about 15 minutes of playing around I just copy pasted its contents into my launch file and works fine. the battery updater/estimator seem to get the setup_path correctly, and I'm not 100% sure why it is that this launch file isn't quite working (perhaps the opaque function?)

Actual behaviour

Works:


    launch_diagnostics = GroupAction([
        Node(
            package='diagnostic_aggregator',
            executable='aggregator_node',
            output='screen',
            parameters=[PathJoinSubstitution([
                get_package_share_directory('clearpath_diagnostics'), 'config', 'diagnostics.yaml'])],
            remappings=[
                ('/diagnostics', 'diagnostics'),
                ('/diagnostics_agg', 'diagnostics_agg'),
                ('/diagnostics_toplevel_state', 'diagnostics_toplevel_state')],
            condition=UnlessCondition(use_simulation)),
        Node(
            package='clearpath_diagnostics',
            executable='diagnostics_updater',
            output='screen',
            remappings=[
                ('/diagnostics', 'diagnostics'),
                ('/diagnostics_agg', 'diagnostics_agg'),
                ('/diagnostics_toplevel_state', 'diagnostics_toplevel_state')],
            arguments=['-s', setup_path],
            condition=UnlessCondition(use_simulation))
    ])
luis-camero commented 3 months ago

This issue was likely to do with the setup_path being passed in. The path resolution was naive and expected a directory to end with a / in order to join the robot.yaml file to the directory path. I'm assuming that this was the cause of your issues and why you were able to resolve it by getting rid of the requirement on the namespace, and therefore did not need to use the opaque function to load the robot.yaml. I have made the fix in #62.