drake

Why create a standalone plant just for the controller


I am studying manipulation simulation with use of MIT Robotic Manipulation Notes. I don't understand the reasoning behind the one particular complication in code.

The authors insist on instantiating a separate plant just for the controller. E.g., if one was to use the helper functions from maniputalation repository:

Later, not much is happening to the controller-aggregated plant: it just has plant.SetPositions(...) called on it, i.e. being brought into the configuration, matching that of "main" plant. (in code: see the definition of TorqueController.CalcTorqueOutput).

Beside the example listed above, I remember seing this same pattern of plant usage somewhere in drake or manipulation some time ago.

In my own experiments, I managed to have a control strategy working without an extra plant, by re-using the "main" plant by reference in the controller class instance.

But I wanted to ask for the sake of better understanding drake library, why authors make a separate plant?

One guess that I have is maybe the reason is dimensionality? The controller needs a plant that doesn't have any other dimensions except the joints, which the controller tries to control?


Solution

  • Model-based control uses a "best-guess" plant for use by the controller. If all things were perfect, the best-guess plant matches the actual plant. To test how robust the model-based controller is, it helps to have an actual plant that differs in many ways, e.g., the mass, center of mass, and inertia of bodies, the location of joints, actuator limits, friction constants, sensor models, etc.

    Hence, it is helpful to have two plants. One for the controller and one for the actual plant.