Skip to content

Conversation

@soham2560
Copy link
Contributor

@soham2560 soham2560 commented Aug 22, 2025

Brief

This PR showcases the feature added by ros-controls/ros2_control#2476

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor details, mostly fixing RST syntax:

  • Should we also add the usage of the new CLI verb here?
  • Let's use this example for an integration test, and add WaitForTopic tests in test_robot_launch.py?
  • please revert the double->int change as we have decided on the other PR.

This example shows how to publish diagnostics and status messages from a hardware component using ROS 2 features available within the ``ros2_control`` framework.

It is essentially the same as Example 1, but with a modified hardware interface plugin that demonstrates two methods for publishing status information:
1. Using the standard ``diagnostic_updater`` on the default node to publish to the ``/diagnostics`` topic. This is the recommended approach for hardware status reporting.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have two recommended approachs here ;) what is best practice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea I think the wording was not clear enough,

  1. is supposed to be for doing status reporting with diagnostics
  2. is for standard hardware status reporting as defined by https://github.com/ros-controls/roadmap/blob/master/design_drafts/hardware_status.md

I have updated in e87c860, hope thats better

- Uses message type ``diagnostic_msgs/msg/DiagnosticArray``.
- Custom node:
- Is named ``<hardware_name>_custom_node`` (e.g., ``/rrbot_custom_node``).
- Publishes on the topic ``/rrbot_custom_status``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing newlines also above, but I can't suggest in no-change lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refer dc64b9d

Comment on lines 150 to 153
stamp:
sec: 0
nanosec: 0
frame_id: ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, have updated with 6627a00 and
24b31da

This will create a publisher on the topic ``/rrbot/hardware_status``.

.. _diagnostic_publisher_implementation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after The key steps are: there is also a newline missing, sphinx does not like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refer dc64b9d

yea my sphinx skills are really subpar lol, need to improve

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants