Skip to content

Updater::add to take ownership of FunctionDiagnosticTask #309

Open

Description

@russkel

I believe this should probably be supported:

  diagnostic_updater::FunctionDiagnosticTask helm_diag(
          "Helm", [&helm_report](diagnostic_updater::DiagnosticStatusWrapper & stat) {
              stat.add("Modes", helm_report.getModeSummary());
              stat.add("Halted", helm_report.getHalted());
          });

  diag_updater->add(std::move(helm_diag));

Unfortunately, this doesn't work and segfaults when helm_diag goes out of scope.

Activity

  1. changed the title [-]Updater::add to accept lambdas[/-] [+]Updater::add to take ownership of FunctionDiagnosticTask[/+] on Jul 31, 2023
  2. ct2034 commented on Sep 26, 2023

    @ct2034
    Collaborator

    Thanks for your issue, @russkel.
    Could you please describe what you are trying to achieve in more detail? What is ivp_diag?
    Please feel free to provide a test that and / or implementation in a pull request.

  3. russkel commented on Sep 27, 2023

    @russkel
    Author

    What is ivp_diag?

    A mistake in my copy and paste, apologies. It should be helm_diag.

    Please feel free to provide a test that and / or implementation in a pull request.

    Okay. We (my colleague and I) were a bit surprised by the interface to the diagnostic_updater and felt it could probably be easier. We hope to improve this or at the very least have specific feature requests.

  4. added
    PR welcome 💞This issue has no PR that tries to implement it. Please create one!
    on May 21, 2026
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

    PR welcome 💞This issue has no PR that tries to implement it. Please create one!needs more workSomeone has worked on this but more work is neededros2PR tackling a ROS2 branch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions