epfl-lasa / control-libraries

A collection of library modules to facilitate the creation of full control loop algorithms, including state representation, motion planning, kinematics, dynamics and control.
https://epfl-lasa.github.io/control-libraries
GNU General Public License v3.0
27 stars 2 forks source link

Add force limit to impedance controller #276

Closed eeberhard closed 2 years ago

eeberhard commented 2 years ago

This seems like a useful thing to add, so that we can specify max force in task or joint space at individual degrees of freedom. An impedance controller operating on the robot definitely needs this behaviour, and usually I would clamp the command to some norm after calling compute_command. Now it can be done directly by the controller with a higher degree of adjustment.

@buschbapti @domire8

eeberhard commented 2 years ago

maybe rename clamp_force to clamp_command

I stayed with force throughout as a general term for force, torque, wrench (e.g. energy exchange over distance)

the clamping should be done directly at the state level

The clamp_state_variable method of CartesianState takes only a max norm of the vector. I decided, at the controller plugin level, it's useful to be able to separate the degrees of freedom for more fine control.

Perhaps at some point a clamp_state_variable method could be overloaded with a vector signature, so that it applies the element wise limits rather than the norm. But I didn't see this as necessary for this PR. If the same logic is reimplemented in another place, then we can refactor it to be in the base class.

buschbapti commented 2 years ago

Thanks for the clarification. We can indeed see later if that is a function we want to be implemented upstream.