Having multiple controllers communicate in a shared-memory fashion, potential through a shared hardware interface, would be highly desirable.
For instance, when programming Sawyer’s ROS Control Gazebo node to achieve “Gravity Compensation”, we needed a controller to estimate arm Effort due to Gravity, Inertia, and Coriolis forces based on the current arm configuration and then combine that with the desired commanded control mode (Position PID, Velocity PID, or direct Effort).
We achieved this with a custom Hardware Interface package that would allow controllers to “share” the control over a single interface (like Position PID + Gravity compensation), and sum their component efforts to achieve the desired command without needing to worry about Gravity-related forces.
The code is all there on github, but I never took the time to figure out how to contribute the useful bits back to ros_controls. I’d be interested in helping make this part of the ROS2 ros_controls Hardware Interface.