ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Using diagnostic_updater in a ros2_control resource (actuator etc)

asked 2021-06-16 04:53:34 -0500

Webadone gravatar image

Hi!

In ROS 1 I use an diagnostic_updater::Updater to publish hardware infos like status/error words, current device mode etc. The usage is pretty straight forward like creating the diagnostic Updater in my RobotHW instance and registering a updateDiagnostics(diagnostic_updater::DiagnosticStatusWrapper& stat) method for each hw component to it.

Doing this in ros2_control resource like an Actuator etc. seems to be not that easy. The Updater ctor now needs a NodeT https://github.com/ros/diagnostics/bl... which makes sense since it needs to create the publisher.

My actuator is define like class RobotMotorActuator : public BaseInterface<ActuatorInterface> - so no access to a NodeT. I was thinking if I can get somehow the NodeT of the ControllerManager which I guess is actually the node loading my driver with the ResourceManager but I did not find a way to retrive it (for a reason? :) )

Maybe there is now a different best pratice. As an alternative I'm thining about a bunch of own StateInterface definitions and perform the Diagnostics in the controller.

Long story short - what is the intended way of bringing hardware diagnostic informations to the diagnostics 'subsystem' in ros2_control?

Thanks a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-16 06:46:18 -0500

gvdhoorn gravatar image

Maybe there is now a different best pratice.

well, it was actually never a best practice to publish directly from hardware_interfaces. It was possible, but afaik the idea was always to have controllers publish and subscribe (ie: do all the non RT safe things).

As an alternative I'm thining about a bunch of own StateInterface definitions and perform the Diagnostics in the controller.

exactly, this would be the preferred way.

This is not specific to diagnostics information though. Controllers (or these days also Broadcasters) should be used to interact with the ROS-side.

edit flag offensive delete link more

Comments

Thanks for your quick reply! Yes understood, that makes of course sense to me.

Webadone gravatar image Webadone  ( 2021-06-16 07:01:03 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2021-06-16 04:53:34 -0500

Seen: 442 times

Last updated: Jun 16 '21