ros-controls / ros2_controllers

Generic robotic controllers to accompany ros2_control
https://control.ros.org
Apache License 2.0
321 stars 290 forks source link

🚀 Add PID controller 🎉 (backport #434, #975, #899, #1084, #951) #1162

Open mergify[bot] opened 1 month ago

mergify[bot] commented 1 month ago

Proposal for a new controller that provides PID functionality.

The controller can be used stand-alone, in a chain. Measured states can be provided through the topic or state interface, depening on the concrete control arch. For example, if you are having an external estimator, using topic might be eaiser at first then full integration into ros2_control.

The PR depends the following changes:

Looking forward for your feedback!

Testing dependencies:

  control_msgs:
    type: git
    url: git@github.com:ros-controls/control_msgs.git
    version: add-generic-msgs-for-controller-references
  control_toolbox:
    type: git
    url: git@github.com:ros-controls/control_toolbox.git
    version: add-option-to-define-prefix-as-param-prefix
  ros2_controllers:
    type: git
    url: git@github.com:StoglRobotics-forks/ros2_controllers.git
    version: add-pid-controller


This is an automatic backport of pull request #434 done by Mergify.

christophfroehlich commented 1 month ago

Needs https://github.com/ros-controls/control_msgs/pull/133 to be released for the binary builds.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 84.28875% with 74 lines in your changes missing coverage. Please review.

Project coverage is 86.48%. Comparing base (deeb9d0) to head (5eb6df8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## humble #1162 +/- ## ========================================== - Coverage 86.66% 86.48% -0.18% ========================================== Files 86 91 +5 Lines 7485 7957 +472 Branches 616 694 +78 ========================================== + Hits 6487 6882 +395 - Misses 767 822 +55 - Partials 231 253 +22 ``` | [Flag](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | `86.48% <84.28%> (-0.18%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [pid\_controller/test/test\_load\_pid\_controller.cpp](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162?src=pr&el=tree&filepath=pid_controller%2Ftest%2Ftest_load_pid_controller.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-cGlkX2NvbnRyb2xsZXIvdGVzdC90ZXN0X2xvYWRfcGlkX2NvbnRyb2xsZXIuY3Bw) | `100.00% <100.00%> (ø)` | | | [pid\_controller/test/test\_pid\_controller.cpp](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162?src=pr&el=tree&filepath=pid_controller%2Ftest%2Ftest_pid_controller.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-cGlkX2NvbnRyb2xsZXIvdGVzdC90ZXN0X3BpZF9jb250cm9sbGVyLmNwcA==) | `100.00% <100.00%> (ø)` | | | [...\_controller/test/test\_pid\_controller\_preceding.cpp](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162?src=pr&el=tree&filepath=pid_controller%2Ftest%2Ftest_pid_controller_preceding.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-cGlkX2NvbnRyb2xsZXIvdGVzdC90ZXN0X3BpZF9jb250cm9sbGVyX3ByZWNlZGluZy5jcHA=) | `100.00% <100.00%> (ø)` | | | [pid\_controller/test/test\_pid\_controller.hpp](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162?src=pr&el=tree&filepath=pid_controller%2Ftest%2Ftest_pid_controller.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-cGlkX2NvbnRyb2xsZXIvdGVzdC90ZXN0X3BpZF9jb250cm9sbGVyLmhwcA==) | `83.14% <83.14%> (ø)` | | | [pid\_controller/src/pid\_controller.cpp](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162?src=pr&el=tree&filepath=pid_controller%2Fsrc%2Fpid_controller.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-cGlkX2NvbnRyb2xsZXIvc3JjL3BpZF9jb250cm9sbGVyLmNwcA==) | `70.79% <70.79%> (ø)` | | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1162/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls)
cooperrunyan commented 2 weeks ago

Needs ros-controls/control_msgs#133 to be released for the binary builds.

@christophfroehlich, That has been merged, right? Can the build check just be re-triggered?

christophfroehlich commented 2 weeks ago

Needs ros-controls/control_msgs#133 to be released for the binary builds.

@christophfroehlich, That has been merged, right? Can the build check just be re-triggered?

The binary build check fails until control_msgs has been released (there is a release, waiting for the next sync). I think this PR can be merged now, too @bmagyar ?