The two PID loops (in ros_control and in your motor controller) can work together without a problem. You should use both. The ros_control one typically has more cpu available, so it may be able to output better commands to the motor controller, giving you nicer robot motion (compared to using the motor controller one alone.)
Originally posted by Mike Scheutzow with karma: 4903 on 2022-09-28
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by gvdhoorn on 2022-09-30:
Something which is unclear to many users is that the majority of ros_control
controllers don't actually implement PID control. Most of them are instances of ForwardCommandController
, which don't implement any control law whatsoever. They simply forward the incoming setpoint to the underlying hardware resource (ie: joint).
The main purpose of those controllers is to use them with the kind of setup described by @CoffeeKangaroo: there is an embedded/remote system which already implements (PID-based or more advanced) motion control, but it's desirable to abstract that all away behind the same controller interfaces as all the other ros_control
controllers.
That's when you'd use a forwarding command controller.
It's been mentioned a few times here on ROS Answers already, but ros_control
is really much more of a resource management framework.
Comment by CoffeeKangaroo on 2022-09-30:
Thanks for the clue! I am aware that there are ForwardCommandController
s. I am using such a controller right now. I did not know that this controller is designed to be the solution to my problem.
Comment by gvdhoorn on 2022-09-30:
It's not really a problem that's being solved. It's just a different sw+hw configuration for a different use-case.