Skip to content

why we need add_analyzer_node in the very 1st place? #670

Open

Description

@fujitatomoya

https://github.com/ros/diagnostics/blob/ros2/diagnostic_aggregator/src/add_analyzer.cpp, i believe that we can replace this with ros2 param load /analyzers example_add_analyzers.yaml.

It is a relay that reads its own parameters and pushes them to another node. The filter heuristic, keeping any key whose sibling has .path, is fragile. It adds a binary and a README section for what is one CLI line. And it makes the aggregator's dynamic-reload behavior look like it requires a helper, when it does not.

I'd pick one of:

  • Keep the aggregator's parameter-callback reload, delete this node, and document ros2 param load plus a launch snippet using an OnProcessStart handler or RegisterEventHandler to sequence it.
  • Make the aggregator itself accept a list of extra analyzer YAML files or a dedicated add_analyzers service, so the client side is trivial and the "does this parameter belong to an analyzer" logic lives in one place.

Activity

  1. MCFurry commented on Oct 26, 2026

    @MCFurry
    Contributor

    Hmm you might have a point here...

    I know we (@Timple, @MartinCornelis2) needed this in ROS1 and thus ported it over to ROS2 at some point.
    We like to keep analyzers together with a driver in our launch-files, such that for different robot configurations you can decide to load a driver or not and automatically load the diagnostic analyzer for that driver as well.
    In ROS1, loading to the analyzers parameter would overwrite the current list of analyzers however, which is why there was an add_analyzer to dymamically extend the list of active analyzers.

    But testing now in Jazzy, it seems that loading a single analyzer to /diagnostics/analyzers extends the list already! So maybe the need for this node is gone indeed.

  2. MCFurry commented on Oct 26, 2026

    @MCFurry
    Contributor

    The only culprit I found so far:

    One can easily replace:

    <node name="add_analyzer_lidar_driver" pkg="diagnostic_aggregator" exec="add_analyzer" >
        <param from="$(find-pkg-share awesome_robot)/param/diagnostic_analyzers/lidar_analyzer.yaml" allow_substs="true"/>
        <remap from="/analyzers/set_parameters_atomically" to="/diagnostics/set_parameters_atomically" />
    </node>
    

    With:

    <executable cmd="ros2 param load /diagnostics $(find-pkg-share awesome_robot)/param/diagnostic_analyzers/lidar_analyzer.yaml"/>
    

    Except that the allow_substs="true" part doesn't work like this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions