Any PID-based "controller_interface::ControllerInterface" implementations/examples for ROS2?
ROS2 has the forward_command_controller::ForwardCommandController
base class, and position/effort/velocity-based sub-classes, but all they do is to set the joint position/velocity/effort value directly on the respective joint interface, without any error-based feedback control loop.
Is there an equivalent PID-based implementation of the controller_interface::ControllerInterface
interface that has an error-feedback loop between control input and state output that could be applied across interfaces (such as, effort control with positional error feedback)? I've seen other PID controllers that are independent of the ros2_control framework, which I am not referring to. I'm specifically looking for a PID based controller that works within the pluggable ros2_control framework.
More specifically, say I have a <ros2_control> tag as below in my URDF:
<ros2_control name="pole" type="system">
<hardware>
<plugin>my_hardware/MyHardwareInterface</plugin>
<param name="blah">some_value</param>
</hardware>
<joint name="pole_joint">
<state_interface name="position"/> <<<<<<<< POSITION (TARGET VALUE)
<command_interface name="effort"> <<<<<<<< EFFORT (CONTROL INPUT)
<param name="min">0.0</param>
<param name="max">1.0</param>
<param name="initial_value">0.0</param>
</command_interface>
</joint>
</ros2_control>
I want to define a controller for the pole_joint
's position, but I need a PID-based feedback loop, since the control and state interfaces are different. (Furthermore, even if the command and state interfaces were the same, the hardware will not offer "instant" enforcement of the target value, which the ForwardCommandController seems to assume). Am I going to be forced to implement a PID mechanism within the MyHardwareInterface class, or is it possible to utilize an off-the-shelf PID-based ros2_controller that would work universally with any hardware interface (and for any command/state interface combination for feedback control)?
Some instructions or link to an example implementation+configuration would be greatly appreciated.
Thanks in advance.