Skip to content

Allow diagnostics to be published from a hardware_interface #1732

Open
@Timple

Description

@Timple

Is your feature request related to a problem? Please describe.
For an actuator, often the actuator reports more values that just the measured one. For example current power consumed. It would be nice to have this information available on the /diagnostics topic.

Describe the solution you'd like
A way to easily supply diagnostics from a hardware_interface. For example:

hardware_interface::return_type MyActuator::read(const rclcpp::Time &, const rclcpp::Duration &);

hardware_interface::return_type MyActuator::write(const rclcpp::Time &, const rclcpp::Duration &);

hardware_interface::return_type MyActuator::produce_diagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat);

Or:

hardware_interface::CallbackReturn on_configure(const rclcpp_lifecycle::State & previous_state);

hardware_interface::CallbackReturn add_diagnostic_task(const DiagnosticTask * t);

Describe alternatives you've considered
Creating a diagnostic_updater_ class member. Which also needs a node_ and then spin an executor. Like this: https://github.com/nicklgw/bdrive_hardware_interface/blob/f557bf1111f6ecc2df0389d25c7e73225e294a61/src/bdrive_hardware_interface.cpp#L93

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions